`
mindfocus
  • 浏览: 17028 次
  • 性别: Icon_minigender_1
  • 来自: 福州
社区版块
存档分类
最新评论

Lisp

阅读更多
1) John McCarthy's Home Page
http://www-formal.stanford.edu/jmc/


2) Lisp之根源
http://daiyuwen.freeshell.org/gb/rol/roots_of_lisp.html#foot84

约翰麦卡锡于1960年发表了一篇非凡的论文,他在这篇论文中对编程的贡献有如 欧几里德对几何的贡献.1 他向我们展示了,在只给定几个简单的操作符和一个 表示函数的记号的基础上, 如何构造出一个完整的编程语言. 麦卡锡称这种语 言为Lisp, 意为List Processing, 因为他的主要思想之一是用一种简单的数据结构表(list)来代表代码和数据.

值得注意的是,麦卡锡所作的发现,不仅是计算机史上划时代的大事, 而且是一种 在我们这个时代编程越来越趋向的模式.我认为目前为止只有两种真正干净利落, 始终如一的编程模式:C语言模式和Lisp语言模式.此二者就象两座高地, 在它们 中间是尤如沼泽的低地.随着计算机变得越来越强大,新开发的语言一直在坚定地 趋向于Lisp模式. 二十年来,开发新编程语言的一个流行的秘决是,取C语言的计 算模式,逐渐地往上加Lisp模式的特性,例如运行时类型和无用单元收集.

在这篇文章中我尽可能用最简单的术语来解释约翰麦卡锡所做的发现. 关键是我 们不仅要学习某个人四十年前得出的有趣理论结果, 而且展示编程语言的发展方 向. Lisp的不同寻常之处--也就是它优质的定义--是它能够自己来编写自己 .为了理解约翰麦卡锡所表述的这个特点,我们将追溯他的步伐,并将他的数学标记 转换成能够运行的Common Lisp代码.

3) CAR & CDR
http://www.iwriteiam.nl/HaCAR_CDR.html

I wrote the first implimenation of a LISP interpreter on the IBM 704 at MIT in early in 1959. I hand-compiled John McCarthy's "Universal LISP Function".
The 704 family (704, 709, 7090) had "Address" and "Decrement" fields that were 15 bits long in some of the looping instructions. There were also special load and store instructions that moved these 15-bit addresses between memory and the index regiseters ( 3 on the 704, 7 on the others )

We had devised a representation for list structure that took advantage of these instructions.

Because of an unfortunate temporary lapse of inspiration, we couldn't think of any other names for the 2 pointers in a list node than "address" and "decrement", so we called the functions CAR for "Contents of Address of Register" and CDR for "Contents of Decrement of Register".

After several months and giving a few classes in LISP, we realized that "first" and "rest" were better names, and we (John McCarthy, I and some of the rest of the AI Project) tried to get people to use them instead.

Alas, it was too late! We couldn't make it stick at all. So we have CAR and CDR.

As the 704 has 36 bit words, there were 6 bits in the list nodes that were not used. Our initial implimentation did not use them at all, but the first garbage collector, comissioned in the summer of 1959, used some of them as flags.

Atoms were indicated by having the special value of all 1's in car of the first word of the property list. All 0's was NIL, the list terminator.

We were attempting to improve on "IPL-V", (for Interpretive Processing of Lists - version 5) which ran on a 650. I believe that the 0 list terminator was used there, but I believe that the all 1's flag for atoms was original.

Hope this is enlightening.


After these historical blind alleys, it's interesting to think about why car and cdr still persist fifty years after McCarthy and Russell roamed the halls of MIT evangelising first and rest. Common Lisp does at least have first and rest as part of the standard. However, when I was taught Lisp in the mid-90's, I was encouraged to primarily favor the older car and cdr.I remember two primary reasons for this. The first was that existing code favored car and cdr, so it was important to be able to read code written in that style. The second reason was that first and rest impose a particular meaning on the fields of a cons cell that may or may not be appropriate. In the common case of a linear list, first and rest work rather well. If you call first on the list, you get the first element, if you call rest, you get the rest. In the case of a cons cell as a node of an association list, they work less well, unless, that is, you can figure out a reason why first makes sense as 'key', and rest makes sense as 'value'.


4) Lisp的wiki
http://zh.wikipedia.org/zh-cn/LISP
http://lisp.org.cn/wiki/

5) Lisp方言
http://www.schemers.org/
http://www.lisp.org/alu/home
http://www.gnu.org/software/gcl/
分享到:
评论

相关推荐

    AutoCAD完全应用指南—AutoLISP DCL Visual LISP程序设计篇(随书光盘)

    《autocad完全应用指南.autolisp+dcl+visual lisp程序设计篇》重点讲解autolisp、dcl、visual lisp三合一的autocad二次程序开发技术。《autocad完全应用指南.autolisp+dcl+visual lisp程序设计篇》分为4篇,共35章。...

    autocad完全应用指南.autolisp+dcl+visuallisp程序设计篇(2011年4月第一版).part4.rar

    《autocad完全应用指南.autolisp+dcl+visuallisp程序设计篇》重点讲解autolisp、dcl、visuallisp三合一的autocad二次程序开发技术。《autocad完全应用指南.autolisp+dcl+visuallisp程序设计篇》分为4篇,共35章。第1...

    cad lisp 初级教程

    AutoLISP是一种针对扩充及自订AutoCAD函数机能而产生,以LISP为基础的程序设计语言.LISP本身于50年代末期出现,是一种擅于处理串行文字(List of Processing),属第四代人工智能(Artificial Intelligence)的计算机...

    autocad完全应用指南.autolisp+dcl+visuallisp程序设计篇(2011年4月第一版).part1.rar

    《autocad完全应用指南.autolisp+dcl+visuallisp程序设计篇》重点讲解autolisp、dcl、visuallisp三合一的autocad二次程序开发技术。《autocad完全应用指南.autolisp+dcl+visuallisp程序设计篇》分为4篇,共35章。第1...

    AutoLISP 编程.zip_autoLisp编程_autolisp_autolisp教程_lisp编程

    autolisp教程,供大家学习,来之不易

    VISUAL LISP教程(AutoCAD2000)_visualLISP语法_lisp_autolisp语法_教程_

    学好 AutoLISP 的关键、 基本结构与语法:1. AutoLISP 程序语言的特质 A.语法简单B.功能函数强大C.撰写的环境不挑剃D.直译式程序『即写即测、即测即用』E.横跨 AutoCAD 各作业平台悠然自得 (注:以上五点读者可以参考...

    cad常用的lisp大全

    800个cad常用的lisp大全 ========================================= 主要功能: 将autocad的spl线转换为pl线,这对于园林设计的朋友们是个很好的程序,方便了很多。 特别是做园路,绿化部分的操作。 =============...

    lisp语言用Delaunay三角网法求土石方量

    本程序为lisp语言编写的AutoCAD二次开发程序,包括lisp源程序代码和程序测试图。 本程序适合AutoCAD二次开发初学者学习之用,代码比较简单,所用函数也都是基本的函数,并且程序中包含详细注释。适合大学测绘、采矿...

    [Lisp]AutoLISP入门教学.chm

    AutoLISP 是何方神圣? AutoLISP是AutoCAD的最佳拍檔! AutoLISP内含于AutoCAD软件内,不用另外花钱买! AutoLISP是强化AutoCAD最好、最直接的『程序语言』! AutoLISP易学、易用,即使不会程序设计的AutoCAD使用者,...

    LISP 程序最新知识

    一、AutOLISP是何方神圣 ★AutoLISP是AutoCAD的最佳搭档! ★AutoLISP内含于AutoCAD软件内,不用另外花钱买! ★AutoLISP是强化AutoCAD最好、最直接的“程序语言”! ★AutoLISP易学、易用,即使不会程序设计的...

    LISP函数大全分类手册

    LISP函数大全

    Successful Lisp How to Understand and Use Common Lisp - David B. Lamkins

    Provides an overview of Common Lisp for the working programmer. Introduces key concepts in an easy-to-read format. Describes format, typical use, and possible drawbacks of all important Lisp ...

    lisp程序含四个小程序

    本程序为lisp语言编写的AutoCAD二次开发程序,包括lisp源程序代码,dcl可视化窗口代码,程序测试图,以及程序中用到的插入图块文件和幻灯片文件。 本程序适合AutoCAD二次开发初学者学习之用,代码比较简单,所用函数...

    [Lisp]autolisp及vlisp函数全集.exe

    [Lisp]autolisp及vlisp函数全集.exe[Lisp]autolisp及vlisp函数全集.exe很好值得推荐

    Visual LISP教程(中文翻译版)_lisp_

    visual lisp中文教程 chm翻译版

    ansi common lisp 教程

    作为一个核心文本的补充在任何课程涵盖如Common Lisp的人工智能程序设计语言的概念。新的和更强大的方法教育学生的思考程序,该文本包含一个教程的例子,说明Lisp编程的基本概念,以及ANSI Common Lisp的一个跟上...

    实用Common.Lisp编程

    这本《Practical Common Lisp》之所以号称Practical,正是因为这本书大量介绍Common Lisp在现实世界中的各种应用方式,算是第一本「入世传教」的Common Lisp著作。《Practical Common Lisp》是目前最畅销的Common ...

    AutoLisp入门教程

    AutoLisp入门教程 lisp语言很好的入门教材 lisp语法定义比较全面

    CAD lisp 自动计算面积

    CAD lisp 自动计算面积CAD lisp 自动计算面积CAD lisp 自动计算面积CAD lisp 自动计算面积

    在裸机 x86-64硬件(WIP) 上运行的 Lisp 操作系统_lisp_代码_相关文件_下载

    Yalo 是一个运行在裸机 x86-64 硬件上的 Lisp 操作系统。系统编程语言是Ink,一种新的 Lisp 方言,它结合了 Scheme 的优雅和 Common Lisp 的强大功能 使用 Common Lisp 编写的汇编程序和 64 位引导加载程序。 VGA ...

Global site tag (gtag.js) - Google Analytics