LOGO-L> Primitive or Library Procedure? 
Author Message
 LOGO-L> Primitive or Library Procedure?

George,

You asked me why I insisit that the information about the position of
any turtle (when I use more than one turtle) MUST be a primitive and not
a library procedure. Here's my reasoning:

*       I'm located at, say, turtle 1, and I want to know the location
of
turtle n (n>1). The lib. procedure you suggested sends me to turtle n,
I ask him his position, and then I return to the turtle 1. This is
clumsy
and not real Logo.

*       According to your suggestion, another lib. procedure is needed
to find
the direction (TOWARDS) to turtle n, and another lib. procedure to find
the distance (DIST) to turtle n, and another... well, the disadvantages
are clear, I hope.

On the other hand:
Logo "knows" the location of each turtle at any given moment. So it must
be ready to supply that information right away on demand. This can be
done only if TURTLE (or some similar name) is a primitive.

Given such a TURTLE function I can use it DIRECTLY (without any lib.
procedure) to know the position of turtle n, the direction from my
location to it, my distance from it, and maybe more.

Incidently, another primitive-function that's missing in UCBLogo and
MSWLogo in my opinion is DOTCOL that reports the color of a given
location. Such a function can widen the repertoir of Logo's turtle
geometry considerably. I talked about it once or twice with Brian, but
he apparently didn't find it to be of importance.

Regards...

[[Yehuda]]

---------------------------------------------------------------





Wed, 15 Mar 2000 03:00:00 GMT  
 LOGO-L> Primitive or Library Procedure?

Quote:

> The lib. procedure you suggested sends me to turtle n,
>I ask him his position, and then I return to the turtle 1. This is
>clumsy and not real Logo.

On the contrary, it's very much in the Logo tradition for how to handle
multiple turtles.  In Object Logo, for example, you'd say
        ask :turtle1 [setpos ask :turtle2 [pos]]

Quote:
>*       According to your suggestion, another lib. procedure is needed
>to find
>the direction (TOWARDS) to turtle n, and another lib. procedure to find
>the distance (DIST) to turtle n, and another... well, the disadvantages
>are clear, I hope.

This confuses me.  I asked if you want your proposed TURTLE to give all
that information, and you said no, you just want it to output the given
turtle's position.  If all you want is the position, you only need one
library procedure.

Quote:
>Incidently, another primitive-function that's missing in UCBLogo and
>MSWLogo in my opinion is DOTCOL that reports the color of a given
>location. Such a function can widen the repertoir of Logo's turtle
>geometry considerably. I talked about it once or twice with Brian, but
>he apparently didn't find it to be of importance.

No, I just find it to be a lot of trouble.  In general, I'm always more
responsive about things I only have to implement once than about things
I have to implement four different ways (Unix, DOS, Mac, Windows).
George solves this problem a different way: He only supports one
platform (Windows), so graphics things are no harder than anything else.

The central point here is that, like George, I don't agree about the
non-Logo status of the library.  For example, in my mind there is nothing
more central to a good Logo than MAP, but it's a library procedure.
I want to add a new built-in primitive only if it really can't be done
in the library.  For example, I promoted ERALL, ERPS, ERNS, and ERPLS
from library procedures to primitives because the library procedures
require extra memory to run, and one day the reason I wanted to erase stuff
was that I'd run out of memory!  Sometimes I compromise because of a huge
efficiency problem; for example, the primitives FIRSTS and BUTFIRSTS are
there only to support the higher-order functions like MAP.



Wed, 15 Mar 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. LOGO-L> library procedures

2. LOGO-L> Logo procedure problem

3. LOGO-L> primitive listing

4. LOGO-L> MicroWorlds primitives

5. LOGO-L> Clocks and the TIME primitive

6. LOGO-L> Use of the primitive turtletype

7. Logo library procedures

8. LOGO-L> Naming Super Procedure by MAIN

9. LOGO-L> cloning procedures

10. LOGO-L> launch : parallel running of procedures

11. LOGO-L> one procedure from another

 

 
Powered by phpBB® Forum Software