> Comment By: David Costanzo (david_costanzo)
Date: 2010-01-31 21:13
Message:
In Logo, words (which is what other languages calls "strings") are
immutable, so they cannot be modified in-place. The second form of MID$
would have to be implemented by creating a new word that is the
concatenation of the first part of the word with the last part of the
word.
Another problem is that I cannot add a new primitive for this without
breaking backward-compatibility with programs that may define a command
with the same name. Adding it as a LogoLib routine would be safe, but
anyone can do that (you don't need to recompile Logo to write library
routines).
If performance is a concern, then I could extend FIRST, LAST, and ITEM so
that they output the N elements, instead of 1. (FIRST and LAST would take
an additional parameter, and ITEM would optionally take a two-member list,
instead of an index). That said, I'd be surprised if anyone using FMSLogo
is concerned about performance, so a library routine is probably
sufficient.