Inconsistent Behavior of Lists

Robert Brenstein rjb at rz.uni-potsdam.de
Thu Sep 16 05:20:55 EDT 2004


>On Sep 15, 2004, at 6:03 PM, Brian Yennie wrote:
>
>>Dan,
>>
>>It appears to me that you're hitting the difference between strings 
>>and lists. The native data type in Rev is a string, and if you want 
>>it to be treated specially because it follows some sort of list 
>>syntax, you'll need to script that behavior. Otherwise you would 
>>have the opposite effect- many people would be alarmed if spaces 
>>started disappearing from their strings any time they followed a 
>>certain pattern. Unfortunately list is not a native type, whereas 
>>associative arrays and strings are.
>>
>My only contention is that since the list isn't a quoted string and 
>the value following the comma isn't a quoted string, it ought not be 
>forced into being a string.
>
>But I agree there are other times this is exactly what's wanted.
>
>lesson learned. Transcript's treatment of lists is not what I expected.
>

Dan, I am not sure why you expected really anything else. This is not 
a list in the same sense as a list of, for example, variable names 
which is parsed by a compiler. The whole content of each field is 
quoted so to speak when fetched into a variable. So your list is 
really a literal string arbitrarily broken into substrings using some 
character as a substring delimiter. No more, no less.

If your behavior was the standard one, how would one distinguish 
between ,, (an empty item) and , , (a space)?

Robert


More information about the use-livecode mailing list