Lists in Transcript

Robert Brenstein rjb at robelko.com
Tue May 24 08:32:36 EDT 2005


>  > Or are you talking about something else?
>
>But this is pure work with strings, Robert.
>
>Well, I think Revolutioners are used to work with strings.
>Just for me as C++ developer this looks too overhead.
>
>But I see now that Transcript have many special commands to work with
>strings as with lists. And coma is default delimiter as I see.
>
>--
>Best regards,
>
>Ruslan Zasukhin


Whether we use variables as single-value variables or single- or 
multi-dimensional linear lists is up to us. The standard list chunks 
are words (space delimited strings), items (comma-delimited by 
default but could be any character) and lines (the delimiter can also 
be custom). Associative arrays add to that as non-linear lists so do 
speak.

Handling of strings is very powerful and flexible in Transcript, 
although power users would like more, of course :)

You need to remember, Ruslan, that in Transcript variables are 
typeless, so there is no formal distinction between a string and 
numeric value. They are all strings by default.

If v = "2", I can use it as a string as in "a" & v -> "a2" or as a 
number as in 2*v -> 4.

For C++ developer, strings indeed usually mean some overhead. In 
Transcript, purely math operations have some overhead since strings 
have to be converted into numbers. Transcript compiler is now smart 
enough, though, that it can avoid such conversions if it recognizes 
that the variable is used only in numeric context.

Robert


More information about the use-livecode mailing list