2

为什么有些使用#'(lambda而不是只(lambda在 Common Lisp 中使用?有性能优势还是什么?

因为,正如 Peter Siebel 和其他人所解释的那样,在 CL 中,“以下 LAMBDA 表达式:(lambda () 42)在其评估的上下文中出现时扩展为以下内容:(function (lambda () 42))

4

1 回答 1

0

除了几毫秒的编译时间和几毫秒的读取时间之外,没有性能优势:)

我认为真正的原因是一致性。如果一个人写(mapcar #'myfunc ...)(不只是(mapcar myfunc ...)),那么写也是很自然的(mapcar #'(lambda ...) ...)

于 2013-04-13T08:44:21.430 回答