Talk:Brace expansion: Difference between revisions

m
add sig
(attempt to answer all concerns :))
m (add sig)
Line 14:
::::: Yeah, I thought the "closest brace" disambiguation was implied by ''"} closes the last opened alternation group "'' and all the talk about "balanced" brace pairs, but its a good thing you added a more explicit clarification. As for it being "counterintuitive", well, it's how my shell (zsh) handles unbalanced braces, so at least to me it's intuitive... :) --[[User:Smls|Smls]] ([[User talk:Smls|talk]]) 10:16, 26 January 2014 (UTC)
::::: Regarding backslash at the end of the string, I semi-purposefully left that case unspecced, because such inputs may well be impossible in real-life scenarios, and I didn't want to force implementors to complicate their solutions because of it. But I did implement it as "interpret literally and pass along to output" in the Perl solution, just in case. If you think it makes sense as a hard requirement, I'm OK with having it in the spec. Although I would also be fine with something like "''You may assume that input strings will not end with an unescaped backslash''" in the spec. --[[User:Smls|Smls]] ([[User talk:Smls|talk]]) 10:16, 26 January 2014 (UTC)
:::: TimToday is right, I did intend for fault-tolerant parsing (as opposed to throwing an error on malformed input) to be a core aspect of this task (see the "Motivation" section). Of course if it's an unreasonable requirement (e.g. making the task too big/difficult) it could be dropped, but I think that would make the task much less interesting (and there are already many other Rosetta Code tasks that deal with strict parsing). Note that I managed to implement all the requirements in the Perl solution, with plain while loops and a non-backtracking regex (which could even be replaced by low-level 'substr' operations without much difficulty), so it should be possible in Python as well. --[[User:Smls|Smls]] ([[User talk:Smls|talk]]) 10:17, 26 January 2014 (UTC)
:: Hm yeah, I guess requiring solutions to demonstrate the four test cases (with a listing of the actual output), instead of some "toy output", might make sense after all (even if it will make the page very long once there are many implementations). Btw, that Perl 6 solution looks pretty sweet... :) --[[User:Smls|Smls]] ([[User talk:Smls|talk]]) 10:16, 26 January 2014 (UTC)
Anonymous user