Talk:Multisplit: Difference between revisions
Discard verbose description -- no one found it useful, and implementation has been replaced
(→Clarification in order: On the ban.) |
(Discard verbose description -- no one found it useful, and implementation has been replaced) |
||
(21 intermediate revisions by 8 users not shown) | |||
Line 19:
I've reworded the task so that it actually describes the task rather than referring to an implementation. I'm also trying to avoid having it state that the strings and separator information have to be interleaved; that's a very odd thing to do in some languages. My aim was that the solutions given should continue to be solutions, but that the description won't stop other ways of doing the challenge; after all, we ''want'' solutions to tasks to be as idiomatic as possible in their language. –[[User:Dkf|Donal Fellows]] 10:31, 28 February 2011 (UTC)
It seems to me that this task should be split up into the three or four actual tasks that are being confused with each other. --[[User:TimToady|TimToady]] 17:59, 26 April 2011 (UTC)
:I do not know if it needs four tasks, but the API needed for an implementation of both the task and the extra credit could be annoyingly complicated to implement, for some languages and/or implementers. But I suppose the extra credit part currently does have enough ambiguity to spawn several tasks? --[[User:Rdm|Rdm]] 20:30, 26 April 2011 (UTC)
::Actually, I was referring only to the ambiguity in the interpretation of the non-extra credit part. <tt>:)</tt> The degrees of freedom (some since patched in the description) seem to have included 1) whether patterns are to be applied left-to-right in parallel vs each pattern does a split and then each substring is split on subsequent patterns, 2) whether the patterns are meant to be re-used vs the patterns are used once (or maybe even cyclically), and 3) whether the list should be assumed to be ordered vs the function should order them to ensure longest-token matching. Most of this dithering would have been avoided if the task description had been written unambiguously in the first place, but seeing the ambiguities of one's own writing is difficult for most folks... --[[User:TimToady|TimToady]] 23:20, 26 April 2011 (UTC)
==Correct result==
Line 35 ⟶ 41:
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.
=== String modified ===
I noticed another present from the argument earlier. "==d was added by anonymous and not caught making every answer wrong. I will reset it. --[[User:Dgamey|Dgamey]] 01:19, 27 April 2011 (UTC)
===Clarification in order===
Line 82 ⟶ 91:
Is the newest edit to the description wrong? How can it only use the delimiters once in that string? --[[User:Mwn3d|Mwn3d]] 13:10, 26 April 2011 (UTC)
: It should be fixed now. It was another anonymous update just as the ban/protection was going in. --[[User:Dgamey|Dgamey]] 21:40, 26 April 2011 (UTC)
==Small inaccuracy in the smaller non-RE Python version?==
This is a reason to tighten the task description, as I think the task description relies too much on the original Python implementation at the moment. --[[User:Paddy3118|Paddy3118]] 08:16, 28 February 2011 (UTC)
:I'm not tempted in a formulation of Rosetta tasks, therefore feel free to rewrite the task as you see fit.--[[User:DSblizzard|DSblizzard]] 09:33, 28 February 2011 (UTC)
== F# incorrect ==
Line 296 ⟶ 122:
whatever remains of inputString after the last separator gets included in the result
</lang> --[[User:Rdm|Rdm]] 19:57, 21 April 2011 (UTC)
I do not understand the expected results statement in the task description. The task description says "The function should take an input string and an ordered collection of separator strings, and split the string into pieces representing the various substrings."
Given an input string a!===b=!=c, and three separators ==,!= and =, I would expect a result as follows:
a! =b= c
With the operators matching as follows:
a! (==) =b= (!=) c
Note that the third separator is not matched.
--[[User:Markhobley|Markhobley]] 21:43, 9 June 2011 (UTC)
: There has been a lot of confusion over this task. A couple of people took the position that the delimiters were to be matched and not reused. Others took the position that the delimiter order represented priority in matching and they could be reused. This later is the consensus opinion. Having said that at each position left to right see if a delimiter matches. If not advance and try again. Hence: "a" is not a delimiter, "!=" is, now at "==b", "==" (and not "=") is the delimiter. Does that help? --[[User:Dgamey|Dgamey]] 22:46, 9 June 2011 (UTC)
With so many caveats should the F# be just dumped here on the talk page and maybe resurrected as an alternative solution once we have a more compliant F# solution? --[[User:Paddy3118|Paddy3118]] 14:47, 21 July 2011 (UTC)
==No longer draft==
The updated wording looks good. I vote to promote. --[[User:Dgamey|Dgamey]] 00:50, 6 July 2011 (UTC)
:How about waiting for one more good implementation? I have just read the talk page again which makes me want to be sure. --[[User:Paddy3118|Paddy3118]] 06:00, 6 July 2011 (UTC)
:: The task description is much better and the implementations are now pretty consistent. But ok. --[[User:Dgamey|Dgamey]] 14:13, 6 July 2011 (UTC)
== Desired output ==
So what is the desired output of the program? Some solutions on this page only print the fields between the delimiters and don't print anything about the delimiters. Some solutions print a list of alternating fields and delimiters. Others alternate the fields with a pair indicating the type and location of the delimiter. It seems fairly inconsistent. --[[Special:Contributions/208.80.119.68|208.80.119.68]] 23:16, 29 December 2011 (UTC)
: (sigh) This task has had a sordid history and was the subject of some vandalism relating to the intended way to parse it. It appears that the current description could have had a better reviewed after that all died down. The description starting "For these inputs the string should be parsed ..." talks about the expected parsing and output. The output description was added later. As it stands an output of "a b c" works, but this was a late addition to the description. Based on the discussions I would have expected the string to (i) include the substrings and separators so something like "a != == b = != c" works , or (ii) to show the substrings including the null substrings so that something like "a,,b,,c" works. Now where does that leave examples that output "a b c"? My preference would have been for (i) as the separators are at least as interesting as the substrings. However, I'm not sure if reopening this is useful. The main point is does the output clearly show the input was parsed correctly. Keep in mind that any change to the task description that invalidates existing solutions would need to be marked with a template that indicates the task description changed and the example needs improvement. (I forget the template name for this). --[[User:Dgamey|Dgamey]] 04:20, 30 December 2011 (UTC)
|