LOGO没有国际标准

LOGO本身是一种LISP方言(被称作“没有括号的LISP”),按理说是一种函数式程序设计语言。只是用LOGO的几年,脑子里却只有(而且也只把LOGO当成是)命令式程序设计语言。这不能不说是一种悲哀。

刚刚看了一个贴子,某人想实现个LOGO,问LOGO的标准。结果回答是很出乎意料的,LOGO大会曾经讨论过这个问题,但却因为各种LOGO实现之间的差别太大而没有一个统一的标准。LOGO的语法本来就十分简单,但是在这种简单当中,各种LOGO的实现的语法是相当不同的。就连著名的“龟图”也不是所有的LOGO实现都有的。最后一句话,所有LOGO共有的东西只有:
1. 数据结构:字和表。
2. 操作他们的FIRST, LAST, BUTFIRST等东西

贴子来自 comp.lang.logo
"David Waller" <David.Wall...@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
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
C语言是一种广泛使用的编程语言,它具有高效、灵活、可移植性强等特点,被广泛应用于操作系统、嵌入式系统、数据库、编译器等领域的开发。C语言的基本语法包括变量、数据类型、运算符、控制结构(如if语句、循环语句等)、函数、指针等。在编写C程序时,需要注意变量的声明和定义、指针的使用、内存的分配与释放等问题。C语言中常用的数据结构包括: 1. 数组:一种存储同类型数据的结构,可以进行索引访问和修改。 2. 链表:一种存储不同类型数据的结构,每个节点包含数据和指向下一个节点的指针。 3. 栈:一种后进先出(LIFO)的数据结构,可以通过压入(push)和弹出(pop)操作进行数据的存储和取出。 4. 队列:一种先进先出(FIFO)的数据结构,可以通过入队(enqueue)和出队(dequeue)操作进行数据的存储和取出。 5. 树:一种存储具有父子关系的数据结构,可以通过中序遍历、前序遍历和后序遍历等方式进行数据的访问和修改。 6. 图:一种存储具有节点和边关系的数据结构,可以通过广度优先搜索、深度优先搜索等方式进行数据的访问和修改。 这些数据结构在C语言中都有相应的实现方式,可以应用于各种不同的场景。C语言中的各种数据结构都有其优缺点,下面列举一些常见的数据结构的优缺点: 数组: 优点:访问和修改元素的速度非常快,适用于需要频繁读取和修改数据的场合。 缺点:数组的长度是固定的,不适合存储大小不固定的动态数据,另外数组在内存中是连续分配的,当数组较大时可能会导致内存碎片化。 链表: 优点:可以方便地插入和删除元素,适用于需要频繁插入和删除数据的场合。 缺点:访问和修改元素的速度相对较慢,因为需要遍历链表找到指定的节点。 栈: 优点:后进先出(LIFO)的特性使得栈在处理递归和括号匹配等问题时非常方便。 缺点:栈的空间有限,当数据量较大时可能会导致栈溢出。 队列: 优点:先进先出(FIFO)的特性使得

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值