Home
Project Folders
Teacher Resources
Student Resources
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: logo vocab/primitives
From: "Alain Tougas" <alain@xxxxxxx>
Date: Fri, 23 Mar 2007 09:21:18 -0400

<?xml version="1.0" encoding="ISO-8859-1"?>

Hello,



I?ll try to sum it up:



Logo is a language. Like any language, it has a vocabulary and a syntax. The
vocabulary is made of primitives. So primitives are the main constituents of
the Logo vocabulary. The other constituents are the procedures that you
define Procedures are list of instructions that you group under a name (to
square ? end). Primitives are ?always there?, procedures are there if you
define them. There are two types of primitives: the commands and the
reporters. Commands and reporters can require one or more inputs, or none.
Commands execute an action, reporters report a value. When you use a
reporter, you have to make sure that some other logo word (primitive or
procedure) that will ?catch? what?s being reported by the reporter.



Examples:

st (show turle) is a primitive (command) that requires no input

print is a primitive that requires one input

square is a procedure that is present, if you define it:

to square

repeat 4 [fd 50 rt 90]

end

square2 is a procedure that is present if you define it. It needs an input

to square2 :size

repeat 4 [fd :size rt 90]

end

heading is a primitive (reporter).It requires no input, but as a reporter,
it ?throws? a value, that must be caught by another logo word. If you type
just ?heading? in the command center, you will get an error message

I don?t know what to do with 0 (or whatever number)

Here?s an example of some other logo word ?catching? the number thrown by
?heading?

seth heading + 45

heading reports a number (0 in this example). The plus sign wants two
inputs, one before the sign, one after. The one after is 45. For the one
?before?, the plus sign ?catches? the number offered by the reporter heading
(0). The plus sign adds the two (0 + 45) and itself is a reporter. It throws
the result (45) hoping that someone will catch it. The primitive (command)
seth (setheading) needs an input, it will be happy to ?use? the value thrown
in the air by the plus sign.

Bottom line, the first word of a long instruction MUST be a command
(primitive or procedure).



See MicroWorlds?s help, section ?Programming?



Good reading,



Alain



-----Original Message-----
From: mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
[mailto:mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Tamara
Weinstein
Sent: March 23, 2007 8:25 AM
To: mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Subject: logo vocab/primitives



I have a really basic question.

What is the difference between a primitive and logo vocabulary?

Thanks
Tamara Weinstein
Atlanta, GA


  • Previous by thread: logo vocab/primitives
  • Next by thread: Re: logo vocab/primitives

  • To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.


    © copyright 2001 - 2008