Talk:Multisplit: Difference between revisions

F# correct
(→‎F# incorrect: new section)
(F# correct)
Line 231:
a!, =, =, =, b, =, !, =, c
"=" comes first in the delimeters list. <nowiki>"!=" should never be matched because the "=" has already been matched by the first delimeter in the list. If "!=" could be matched before "=", then the order of the delimeters wouldn't matter. Since the order matters, you scan for "=" first.</nowiki> --[[User:Mwn3d|Mwn3d]] 18:50, 21 April 2011 (UTC)
 
:That is not how the splitting algorithm works for the original example (Python), and does not match the task description. The order in which the delimiters appear only matters when multiple delimiters match at the same position. When there is only one delimiter which matches at a position, there is no ambiguity. And the matching is implicitly from left to right. In other words, it's the D and Java implementations which are incorrect, not the F# implementation. --[[User:Rdm|Rdm]] 19:01, 21 April 2011 (UTC)
6,951

edits