Talk:Brace expansion: Difference between revisions
Content added Content deleted
Line 20: | Line 20: | ||
== Duplicate supression == |
== Duplicate supression == |
||
The task currently has an ambiguity - specifically an explicit reference to an implementation (perl 6) which implements a requirement which is not explicitly stated in the task description. |
The task currently has an ambiguity - specifically an explicit reference to an implementation (perl 6) which implements a requirement which is not explicitly stated in the task description. |
||
More specifically, the perl 6 implementation suppresses duplicate results despite no description of this mechanism in the current task description. Consider {a,a,b} as an example which would generate duplicates. This issue shows up in the test case '{,{,gotta have{ ,\, again\, }}more }cowbell!' where nested empty prefixes appear. This case should have eight expansions. You can easily see this by placing a letter to the left of each non-escaped comma. |
More specifically, the perl 6 implementation suppresses duplicate results despite no description of this mechanism in the current task description. Consider {a,a,b} as an example which would generate duplicates. This issue shows up in the test case '{,{,gotta have{ ,\, again\, }}more }cowbell!' where nested empty prefixes appear. This case should have eight expansions. You can easily see this by placing a letter to the left of each non-escaped comma. |
||
This means either the task description is buggy or the reference implementation is buggy. |
This means either the task description is buggy or the reference implementation is buggy. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 18:31, 31 January 2014 (UTC) |
||
:Well, I believe the task actually refers to the Perl (5) implementation, not the Perl 6 one. But leaving that aside, there's no duplicate suppression taking place here. Note what happens when I run these (through the Perl 6 version): |
:Well, I believe the task actually refers to the Perl (5) implementation, not the Perl 6 one. But leaving that aside, there's no duplicate suppression taking place here. Note what happens when I run these (through the Perl 6 version): |
||
<pre>{X,{Y,gotta have{ ,\, again\, }}more }cowbell! |
<pre>{X,{Y,gotta have{ ,\, again\, }}more }cowbell! |
||
Line 44: | Line 44: | ||
:: That's a good point, that brace expansion should be only relevant in the surrounding context where it appears. So that's my bug and hopefully I can find it now. Thank you. --~~ |
:: That's a good point, that brace expansion should be only relevant in the surrounding context where it appears. So that's my bug and hopefully I can find it now. Thank you. --~~ |
||
:: Actually... after thinking about this further... I still think it's a problem. |
|||
:: Let's take aa{,{,11}cc}22 - we expand the inner braces and get aa{,cc}22 and aa{,11cc}22. This should then expand into aa22 aacc22 aa22 and aa11cc22. It seems to me that doing otherwise violates the specification that the inner brace be expanded first. Thoughts? Thanks. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 20:39, 31 January 2014 (UTC) |