小编Y.S*_*Y.S的帖子

如何将函数复制到新符号?

我对Common Lisp中的函数副本有疑问.

在Scheme中我会选择:

(define (foo par1 par2) (+ par1 par2))
(define bar foo)
(print (bar 1 2)) ;; --> prints 3
(define (foo par1 par2) (* par1 par2))
(print (bar 1 2)) ;; --> prints again 3
(print (foo 1 2)) ;; --> prints 2
Run Code Online (Sandbox Code Playgroud)

我怎么能用Common Lisp做到这一点?

lisp scheme common-lisp first-class-functions

1
推荐指数
1
解决办法
62
查看次数

标签 统计

common-lisp ×1

first-class-functions ×1

lisp ×1

scheme ×1