Lisp1 vs Lisp2

(DEFUN PRINT-SQUARES (LIST)
(DOLIST (ELEMENT LIST)
(PRINT (LIST ELEMENT (EXPT ELEMENT 2)))))
(DEFUN PRINT-SQUARES (LST)
(DOLIST (ELEMENT LST)
(PRINT (LIST ELEMENT (EXPT ELEMENT 2)))))

Conslusions:
The advantage of treating the function and argument positions the same is that using parameters as functions is made more convenient syntactically.
The disadvantage is that not using parameters as functions is made less convenient syntactically because parameter names must be more carefully chosen so that they do not shadow the names of globally defined functions that will be needed in the function body.

The above is adopted from https://www.dreamsongs.com/Separation.html, for a full discussion, following the same link.

Note: I wrote this down because I want to give up using Common Lisp, but stay with Scheme. Common Lisp is too complex to me, and utill now, I do not use Loop facility, CLOS, Condition System. In one word, what I want is Scheme, not Common Lisp. Common Lisp does not have publicly available library (except Allegro Common Lisp), too. But SLib is a choice for Scheme, and DrScheme is a free, comprehensive implementation for Scheme, though I missed it at the first time. For macro, I can also use defmacro in Scheme, and it is just more dangerous.
---2006/03/31

PS. I must confess that I am using Common Lisp now.
---2006/07/10

转载于:https://www.cnblogs.com/feisimple/archive/2006/03/31/363219.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值