Talk:Multisplit: Difference between revisions

(→‎Clarification in order: discussion on correct result)
Line 31:
 
:It shouldn't match all possible separators. It should match them in the order that they are given. With that example, the first "==" in "a!===b" is matched and removed from later matching because "==" is the separator that it checks for first. If you change the order of the separators to "!=", "==", "=" then it will match like this: a <!=> <==> b <=> <!=> c. If you change the order to "=", "!=", "==" then it will match like this: a! <=> <=> <=> b <=> ! <=> c. --[[User:Mwn3d|Mwn3d]] 15:27, 21 April 2011 (UTC)
 
::It is true that that is what the D program is doing, but apparently that is not what it is supposed to be doing. The order in which the separators matters is supposed to only be relevant where there is ambiguity at a point. That said, the task currently only implies a "left to right order". But the part of the task description describing when to use the ordering of the separators (when there is ambiguity at a point) only makes sense in a context where something else determines when a point is relevant, or not. --[[User:Rdm|Rdm]] 12:15, 26 April 2011 (UTC)
 
Vincent> Program does exactly what you describe, except your mistake: spearators doesn't reused once they are finished, so for “a!===b=!=c” ("!=", "==", "=") it produces “a <!=> <==> b <=> !=c” - note that '!=' separator doesn't used AGAIN.
6,951

edits