Google 群组不再支持新的 Usenet 帖子或订阅项。历史内容仍可供查看。

Language specification

已查看 5 次
跳至第一个未读帖子

David Waller

未读,
2007年9月29日 17:00:532007/9/29
收件人
Hello, I am looking to develop a new version of logo as part of a project,
but I am struggling to find a good definition of the language apart from
guides to programming. Does anybody know of a good language definition
available for logo.

Thanks
Dave Waller


Brian Harvey

未读,
2007年9月29日 19:23:082007/9/29
收件人
"David Waller" <David....@nospam.Blueyonder.co.uk> writes:
>Does anybody know of a good language definition available for logo.


[FAQ, written 2001.10.8]

At one of the Logo conferences several years ago I ran a session in
which the possibility of a standard was discussed. Many of the Logo
implementors were there, as well as many users. We ended up with
the conclusion that no standard was possible, because there were too
many serious disagreements about syntax, and also because the set of
primitive procedures was constantly in flux.


The main syntactic disagreement was about special forms. In LCSI Logo
and products derived from it, TO is the only exception to the rule that
inputs are evaluated before a procedure is invoked. For example, to
edit a procedure named FOO you must say
EDIT "FOO
so that the word FOO, the procedure's name, is the value of the input
to EDIT. By contrast, in MIT-derived dialects (such as Terrapin), several
primitive procedures are treated as exceptions, so you must say
EDIT FOO
to edit the procedure named FOO.

The advantage of the latter (special form) syntax is that it's more
obvious to a beginner, especially a young one.

The advantage of the former (evaluated) syntax is that it's a more
general mechanism. For example, suppose I have a bunch of procedures
that I want to consider as a unit. I can say
TO MYPROCS
OUTPUT [PROC1 PROC2 PROC3]
END
and then use the instruction
EDIT MYPROCS
to edit those three procedures. In Terrapin syntax it would instead
edit the procedure MYPROCS itself, which isn't what I want this time.
Also, in the long run (some of us think) it's easier to understand;
in MIT-derived dialects you still have to say
MAKE "VAR value
to assign a value to the variable VAR, so you have to explain to
students why you need quotes in that case but not for EDIT!

(Current Terrapin Logo accepts
EDIT (MYPROCS)
to mean that MYPROCS should be invoked to produce a list of procedures
to edit. This gives Terrapin the power of the LCSI notation, at the
cost of adding another special meaning, this time for parentheses, but
it's not documented in their manual.)

Some really recent versions have even more different notations, moving
away from the whole idea of variables, so instead of using MAKE to set
the value and using :VAR to retrieve it, you have procedures SETVAR
and VAR for those purposes, and there are no variables at all.


As for the semantics, what are the essential features of Logo? There
have been versions without turtle graphics, such as the "Music Logo"
that Terrapin sold for the Apple II in which graphics primitives were
replaced with sound generation primitives. At MIT there is a project
in which a small computer is mounted in a Lego brick; it has a different
primitive set from the typical keyboard-and-screen computer. At the
meeting all we agreed on was that anything called Logo should have
the word and list processing primitives (FIRST, BUTFIRST, LAST, BUTLAST,
WORD, SENTENCE, etc.).

[Posted and mailed.]

0 个新帖子