1 Star 0 Fork 0

jiazhenhua / yet-another-lisp-interpreter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
a.scm 415 Bytes
一键复制 编辑 原始数据 按行查看 历史
(+ 2 3) ;简单计算
;基本函数
(define (inc x)(+ x 1))
(inc 4)
;递归函数
(define (fact x)
(cond
((= x 1)1)
(else (* x (fact (- x 1))))))
(fact 5)
;Y组合子
(((lambda (target)
((lambda (f) (f f))
(lambda (f)
(target
(lambda(x) ((f f) x))))))
(lambda (fact)
(lambda (x)
(cond
((= x 1) 1)
(else (* x (fact (- x 1)))))))) 5)
Scheme
1
https://gitee.com/jiazhenhua/yet-another-lisp-interpreter.git
git@gitee.com:jiazhenhua/yet-another-lisp-interpreter.git
jiazhenhua
yet-another-lisp-interpreter
yet-another-lisp-interpreter
master

搜索帮助