代码改变世界

scheme和common lisp 区别

  youxin  阅读(1422)  评论(0编辑  收藏  举报

Scheme and Common Lisp use different names for some of the basic system functions. Many Lisp programs can be translated to the other dialect simply by changing these names (or by providing the existing names as macros or functions). Compatibility packages exist to allow programs in one dialect to run in the other dialect.

The following table gives correspondences between Scheme functions and the equivalent Common Lisp functions.

Scheme: Common Lisp:
(define (fn args ...) code) (defun fn (args ...) code)
begin progn
set! setq
eq? eq
eqv? eql
equal? equal
number? numberp
zero? zerop
pair? consp
null? null
display princ
write prin1
newline terpri
(list-tail lst n) (nthcdr n lst)
(list-ref lst n) (nth n lst)
subset? subsetp
map mapcar
for-each mapc
vector-ref aref
vector-set! (setf (aref ...) val)
substring subseq
#t t
#f nil
'() '() or nil

The following table lists standard Common Lisp functions that are provided in the file initdr.scm.(http://www.cs.utexas.edu/ftp/bogo/cs307/initdr.scm

dotimes
dolist
intersection
union
set-difference
copy-list
subset
every
some
copy-tree
subst
sublis
nconc
nreverse

 

转自:

 

 

 

编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
历史上的今天:
2012-04-01 设置VS visual studio
点击右上角即可分享
微信分享提示