Logo and Natural Language
Logo is well suited to explorations of natural language. This is because Logo's data structures - words and lists - closely parallel the words, phrases, and sentences that make up spoken and written language.
For example, if we type
print sentence "strawberry [ice cream]
Logo displays
strawberry ice cream
on the screen, having made a sentence out of the word "strawberry and the list of two words [ice cream].
The instruction
print sentence [vanilla fudge] [ice cream]
prints
vanilla fudge ice cream
In Exploring Language with Logo, Paul Goldenberg and Wally Feurzeig begin with some gossip;
to gossip
output sentence who doeswhat
endto who
output pick [Sandy Dale Dana Chris]
endto doeswhat
output pick [cheats. [loves to walk.] [talks a mile a minute] yells.]
end
Pick reports an item randomly picked from the list that follows. Who reports a randomly chosen name of a person. Doeswhat reports a randomly selected verb phrase. Gossip puts the two together and reports a sentence.
The instruction print gossip might display
Chris loves to walk.
or
Dana cheats.
or
Dale talks a mile a minute.
or
Dale cheats.
or...
What if we change doeswhat to be:
to doeswhat
output pick [cheats. [loves to walk.] [talks a mile a minute] yells.[ Ford Mustang.]]
end
We could end up with a non-sentence like
Dale Ford Mustang.
So with this playful exercise we can learn something about nouns and verbs.