[Back to GSN Home Page] [Back to Message Index]

Global SchoolNet - Automated Message Archive

LOGO-L> MicroWorlds syntax




KERRB@Magill.UniSA.edu.au
Mon, 08 Jan 1996 20:48:42 +0930

MICROWORLDS SYNTAX

Let me begin by saying that I think MicroWorlds is a great program but I
still find aspects of the syntax confusing. I raised this issue a while
back but still feel it hasn't been adequately responded to. Also I
needed time to explore the program more thoroughly myself to become
satisfied that there wasn't an obvious answer to my query that I was
missing. It seems to me that in developing new objects like text boxes
in MicroWorlds that the Logo syntax has become partially corrupted.
Textboxes sometimes behave like Reporters but not consistently. The use
of quotes has been compromised so it does not always mean take what
follows literally. Moreover the reference manual is confusing in places
and in one place compares textboxes to variables made by make and name,
which they are not. I have tried to systematically document my concerns
below. This is meant to be a constructive post on an issue that I think
will confuse others as they come to terms with MicroWorlds syntax.

Create a textbox and call it word.list. Put these words into this
textbox, with a carriage return (Enter) after each word:

see
bee
meet
feel

Then create another textbox and call it receiver. Make the receiver
textbox active by clicking in it. Next, in the command centre type:

pr word.list

The four words in the word.list textbox will be printed in the receiver
textbox. In this instance the word.list textbox is behaving as a
reporter. No punctuation like : or " is used in front of word.list. It
reports the contents of the textbox (four words) to the print command.

Now type this in the command centre (with the receiver textbox active):

pr textpick "word.list

One of the words of the four in word.list will be printed in receiver.

However, note that word.list is now NOT behaving like a reporter because
this time quotes or " have been used in front of it. In other versions
of Logo quotes or " are NEVER used in front of reporters. This is
because quotes or " have a special meaning in Logo syntax, which means
take the word that follows the quotes literally.

In this command line:

pr textpick "word.list

the expression "word.list does NOT mean the literal word word.list but
it means the long word separated by carriage returns contained within
the textbox word.list.

This is one problem. The syntactical consistency of Logo has been
compromised. In the past quotes or " ALWAYS meant take the word that
followed literally. This is no longer true, the syntax becomes ad hoc,
or at least exceptions have been introduced whereby for SOME new
primitives (textcount, textitem and textpick) the quotes or " means the
contents of the textbox as it is divided by carriage returns or logical
lines. The Reference Manual does address these issues on page 15.

So, a textbox may be conceptualised in one of two ways:
(1) A reporter that contains long words consisting of so many
characters. This sorts of command is appropriate in this mode:

show count word.list (without quotes)
17
The 17 stands for the 14 characters in the 4 words plus 3 carriage
return characters

(2) A sort of container (but a container that behaves differently once
again from the sort of container made by make or name) that contains so
many lines of text separated by carriage returns. This sort of command
is appropriate in this mode:

pr textcount "word.list (with quotes)
4
Because there are 4 lines of text.

So the syntactical inconsistency derives from a conceptual
inconsistency, the text boxes are in fact different sorts of objects
depending on what sort of primitives we use in the command line.
Sometimes text boxes are straightforward reporters. At other times they
are something completely new, a sort of list that is demarcated not by
square brackets [] but by carriage returns.

I would like to see more syntactical consistency rather than just take
an old piece of syntax (quotes or " ) and use it in a different way
because this creates confusion about the syntactical meaning of quotes
or ".

ANOTHER PROBLEM

The Reference Manual says:

"A text box can be used as a container, just like a variable." (page 9).

This comes straight after a section on Variables that describes how to
use make and name.

Well, this is sloppy documentation for a Reference Manual. A text box
can be described as a container I suppose but NOT "just like a
variable." To make a variable word.list you would use:

make "word.list [see bee meet feel]

BTW it is possible to do this even after making a text box called
word.list. Both the variable word.list and the text box word.list can
co-exist as two separate MicroWorlds objects. However, if you try to
create a new Reporter called word.list by:-

to word.list
op [see bee meet feel]
end

then you get the bug message:
"word.list already used"

This is consistent with the view that the text box word.list is a
Reporter but as we have seen above it does not act consistently as a
Reporter.

Going back to using:

make "word.list [see been meet feel]

This makes a container named word.list that contains a LIST (not a long
word and not a new thing separated by carriage returns) containing the 4
words. To access the contents of the container you use this syntax:

pr thing "word.list
or,
pr :word.list

I think this line in Reference Manual, "A text box can be used as a
container, just like a variable." is very confusing and this section
needs to be altered.

POSSIBLE SOLUTION:

Make textboxes behave consistently as reporters but they report
different things depending on the primitives used. Have it so that the
command line:

pr textpick word.list

will pick and display one word from the four words in word.list.

Currently, if you type this command you receive this bug message:
"No text box found for textpick"

Why is it that textbox names cannot be made to be Logo reporters in a
consistent fashion?? If there is some good reason why they can't then
can anyone think of an alternative solution to this problem of
MicroWorlds eroding the meaning of quotes or " ???

---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org. Mail
questions about the list administration to logofdn@gsn.org. To
unsubscribe send unsubscribe logo-l to majordomo@gsn.org.