[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LOGO-L> Re: tool to extend glossaries



Note that I'm CCing this reply to logo-l@gsn.org
see MSWLogo's web page on how to join.

Great question and I wish I saw more questions like
these posted to logo-l@gsn.org.

It's not a bug and Logo did exactly what you told it.

When you called your function (add :adj "brown)
you did not pass your function the thing ADJ but rather
you passed the value of it. Which was assigned to
:Gloss (:Gloss is local to function ADD and now
contains a copy of what ADJ had in it).

Logo does not have pointers but you can pass the
name of the thing you want to operate on. That is,
"ADJ.

Now that you have the name of "ADJ passed to
your function you have to deal with it appropriately.

To obtain the value of the name "ADJ (stored in :Gloss)
you have to construct the :ADJ and run it to obtain it's value.
Use (WORD ": :Gloss) to construct :ADJ and use RUN
to execute :ADJ to obtain it's value for processing.

When you want to assign to ADJ you simply tell
MAKE please assign this new data to "adj which is
exactly what :Gloss will output.

to add :gloss :word
ct
make :gloss combine :word run (word ": :gloss)
make :gloss remdup run (word ": :gloss)
show run (word ": :gloss)
end

Make "adj [orange purple pink black blue]
Add "adj "brown
Show :adj
[brown orange purple pink black blue]

You might want to check out Brian Harvey's books
(see link to his web page also on MSWLogo's web page)
for more advanced coverage of the Logo language.

-----Original Message-----
From: Paul C Dench <Paul.Dench@bigpond.com>
To: mills@softronix.com <mills@softronix.com>
Date: Saturday, May 23, 1998 9:16 AM
Subject: tool to extend glossaries


>Hi Logophiles
>
>I'm trying to upgrade my language tools to run on MswLogo and think I have
>found a bug. Here is a simple example where I'm trying to add new colours
>(and remove any duplicates) to a glossary of adjectives
>
>e.g the command <add :adj "brown>
>
>results in the correct output on the <show :gloss> line
>
>but :adj REMAINS UNCHANGED. 
>
>Is it my lack of understanding or a bug?
>
>Here is my code........
>
>*********************
>
>to add :gloss :word
>ct
>make "gloss combine :word :gloss
>make "gloss remdup :gloss
>show :gloss
>end
>
>Make "adj [pink orange purple pink black blue]
>
>**********************
>
>Your response is awaited with interest
>
>
>
>

---------------------------------------------------------------
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.



Global SchoolNet Foundation - Linking Kids Around the World!
Copyright GSN - All Rights Reserved - Comments & Questions
Visit GSN's Global Schoolhouse for more exciting learning resources!
Search our Site - Home