Difference between revisions of "Talk:Separate Words"
(suggest a project: experiment, specification, design, implementation, documentation) |
m (strike the talk obsoleted by revising SeparateWords to factor out keepSpacers and discardSeparators) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Spacers vs. Separators Contradictions == | |||
This is going to return the wrong answer when there are inclusive or total collisions between separators and spacers. -- [[User:Strife Onizuka|Strife Onizuka]] 09:32, 12 September 2007 (PDT) | This is going to return the wrong answer when there are inclusive or total collisions between separators and spacers. -- [[User:Strife Onizuka|Strife Onizuka]] 09:32, 12 September 2007 (PDT) | ||
Line 6: | Line 8: | ||
We mean to be discussing the astonishing test case of including the same string in both the separators list of strings to keep and yet contradictorily also in the spacers list of strings to discard. | We mean to be discussing the astonishing test case of including the same string in both the separators list of strings to keep and yet contradictorily also in the spacers list of strings to discard. | ||
Similarly astonishing test cases include listing a separator or spacer more than once, listing a separator that contains a spacer, or listing a spacer that contains a separator. | |||
'''Experiment''' | '''Experiment''' | ||
We should experiment with | We should make time to experiment with these test cases, sampling how llParseString2List responds to these cases in world in Second Life. | ||
'''Specification''' | '''Specification''' | ||
As yet we have no specification for these test cases. | |||
Our only sources for specification come up empty: | Our only sources for specification come up empty: | ||
A.175. llParseString2List of the 2007-08-01 "Linden Scripting Language Guide.html" does not discuss | A.175. llParseString2List of the 2007-08-01 "Linden Scripting Language Guide.html" does not discuss these test cases. | ||
The [[llParseString2List]] article of this LSL wiki does not discuss | The [[llParseString2List]] article of this LSL wiki does not discuss these test cases. | ||
'''Design''' | '''Design''' | ||
Line 31: | Line 35: | ||
'''Implementation''' | '''Implementation''' | ||
Maybe we should tweak the separateWords example to complain, via llOwnerSay, any time the programmer | Maybe we should tweak the separateWords example to complain, via llOwnerSay, any time the programmer calling the separateWords function violates a precondition. | ||
Maybe we should tweak the separateWords example to produce the effect of spacer when the same string appears in both lists. | Maybe we should tweak the separateWords example to produce the effect of spacer when the same string appears in both lists. | ||
'''Documentation''' | '''Documentation''' | ||
We | We've edited the [[llParseString2List]] and [[Separate Words]] articles to remind the programmer to work to avoid violating this precondition. | ||
Latest revision as of 18:12, 27 September 2007
Spacers vs. Separators Contradictions
This is going to return the wrong answer when there are inclusive or total collisions between separators and spacers. -- Strife Onizuka 09:32, 12 September 2007 (PDT)
Thought-provoking, thank you, I've responded inline below. -- Ppaatt Lynagh 05:11, 13 September 2007 (PDT)
Context
We mean to be discussing the astonishing test case of including the same string in both the separators list of strings to keep and yet contradictorily also in the spacers list of strings to discard.
Similarly astonishing test cases include listing a separator or spacer more than once, listing a separator that contains a spacer, or listing a spacer that contains a separator.
Experiment
We should make time to experiment with these test cases, sampling how llParseString2List responds to these cases in world in Second Life.
Specification
As yet we have no specification for these test cases.
Our only sources for specification come up empty:
A.175. llParseString2List of the 2007-08-01 "Linden Scripting Language Guide.html" does not discuss these test cases.
The llParseString2List article of this LSL wiki does not discuss these test cases.
Design
We should have designed the llParseString2List function to avoid astonishing the programmer, in this test case as with any test case.
Least astonishing might be for any string found in both lists to have no effect, or have the effect of a spacer, or have the effect of a separator.
We should specify the effect of a spacer, because people testing code are more likely to notice the keep effect of a spacer, rather than the discard effect of a separator, or the null effect you get when you omit a string from both lists.
Implementation
Maybe we should tweak the separateWords example to complain, via llOwnerSay, any time the programmer calling the separateWords function violates a precondition.
Maybe we should tweak the separateWords example to produce the effect of spacer when the same string appears in both lists.
Documentation
We've edited the llParseString2List and Separate Words articles to remind the programmer to work to avoid violating this precondition.