Talk:Multisplit: Difference between revisions
Discard verbose description -- no one found it useful, and implementation has been replaced
(→Clarification in order: Swearing/Helping.) |
(Discard verbose description -- no one found it useful, and implementation has been replaced) |
||
(27 intermediate revisions by 9 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 31 ⟶ 37:
: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.
=== 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 71 ⟶ 82:
: P.P.S. I have written a few task descriptions myself, and usually on R.C. when someone says they have an issue with it, then they are having an issue. It usually points to people being less familiar with something that the task author thinks everyone should know. Try thinking of other ways to explain things on the talk page to DGamey. Look him up, see what they have contributed in the past to RC. If they have added language implementations, then it usually points to a legitimate misunderstanding on their part and helping them usually leads to a better task description for all. --[[User:Paddy3118|Paddy3118]] 11:25, 26 April 2011 (UTC)
: Vincent, This discussion page is full of talk about which interpretation is correct. Whether "==" parses first or "!=" does. It is throughout the "F# is incorrect" talk as well as ours. DSblizzard authored the task and said "D's interpretation is wrong", Rdm says "D and Java implementations which are incorrect", I've also said so. Mwn3d who has made hundreds of contributions got it wrong from the original description. This is very easy to do especially when the task is in draft and changing. If you based your code on one of the examples that has been shown to be incorrect because you thought the code was clearer than the description, it is understandable and inevitable that you would implement code that would also be wrong. There is no shame in that. You're new to RC having written just a handful of tasks. Wading in on a draft task is risky because the task will often change. It is simply how it works. I'm going to put back the clarification in the task description please don't change it unless you can debate here and convince people besides myself that it needs to be another way. --[[User:Dgamey|Dgamey]] 12:07, 26 April 2011 (UTC)
Vincent> "Paddy3118 said: No one abused you.". Wrong. Dgamey tries to defame my solution (on D), while he DOESN'T UNDERSTAND given task himself! (Cite of him: "task isn't specific enough") Question is: how much cost his rubbish above? Nothing. Second, he is CHEATING with original task, putting his output as a "reference". You know what? I f__ed such "specialists" with their sh*ty languages like his "Icon".
I'm new to RC, but it's better than to be "new" for CS at all.
: Vincent has been blocked again for infantile behaviour. I'll second that decision as I like the way RC gets things done without the hate! --[[User:Paddy3118|Paddy3118]] 13:06, 26 April 2011 (UTC)
: Vincent, do not attempt to evade the ban again. If you want the bans repealed before their set expiration time, if you believe this is somehow unfair, or if you believe that you shouldn't have been banned, email me directly. You can find my email address on my user page. You're the first site participant I've ever had to ban, and I'll be happy to explain why via email. If you choose to ''evade'' the ban again, you will no longer be welcome on this site in any capacity, ever. In a short time, you've managed to drive up tempers, ignore reasonable requests and give the community a sour taste. --[[User:Short Circuit|Michael Mol]] 14:12, 26 April 2011 (UTC)
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 284 ⟶ 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)
|