Handling of final delimter (was Re: "this me"?)

Geoff Canyon gcanyon at gmail.com
Thu Aug 15 04:27:11 EDT 2013


On Wed, Aug 14, 2013 at 7:51 PM, Kay C Lan <lan.kc.macmail at gmail.com> wrote:

> Sorry Geoff I just don't follow your logic. Just because one doesn't exist
> why shouldn't the others? If I understand your logic, which clearly I
> don't, you are suggesting that because LC can create and count multiple
> empty lines, and create and count multiple empty items, it should be able
> to create and count a line with 5 empty words in it? Each are counted by
> their own definition, and just because you can do something with one
> doesn't mean you can do the same with the others. LC's current definitions
> can create interesting results:
>
> In the Message Box: (2 lines)
>
> put "Geoff said - " & quote & "The number of words in this line is 11." &
> quote & cr into msg
> put "But LC only counts " & the number of words of msg & " words." after
> msg
>
> Again, I'm not suggesting the current behavior should be changed. I know it
> works consistently. As I said before, I think if HC was first implemented
> with a definition that "test" is 0 items and not a List; and "," is a List
> of 2 empty items, then we wouldn't be having this thread, because as Jacque
> said: it's a "structure that is more similar to real lists in other
> languages".
>


You said, "IMO once you get below two items you no longer have a List." By
that definition, the number of items of "test" is 0, since it is not a
list. You might interpret "test," as a list with the second item empty, or
a non-list that happens to end with a comma, and which contains no items.
Based on that definition, you seem to be saying that the presence or
absence of the delimiters is key; without a comma, there is no list, and
therefore no list items. I was simply extending that to say that the string
"test," with no whitespace, might be said to contain no words, if words are
defined by the whitespace that surrounds them, and likewise if lines are
defined by the returns that surround them. I have some more ideas on this
that I'll write up separately.

The interpretation of quoted text is from the HyperCard days, and seems
like a mistake.



More information about the use-livecode mailing list