What are the actual differences between Scheme and Common Lisp? (Or any other two dialects of Lisp)

后端 未结 4 879
野的像风
野的像风 2021-01-29 23:37

Note: I am not asking which to learn, which is better, or anything like that.

I picked up the free version of SICP because I felt it would be nice to read (I\'v

4条回答
  •  离开以前
    2021-01-29 23:56

    Some basic practical differences:

    • Common Lisp has separate scopes for variables and functions; whereas in Scheme there is just one scope -- functions are values and defining a function with a certain name is just defining a variable set to the lambda. As a result, in Scheme you can use a function name as a variable and store or pass it to other functions, and then perform a call with that variable as if it were a function. But in Common Lisp, you need to explicitly convert a function into a value using (function ...), and explicitly call a function stored in a value using (funcall ...)
    • In Common Lisp, nil (the empty list) is considered false (e.g. in if), and is the only false value. In Scheme, the empty list is considered true, and (the distinct) #f is the only false value

提交回复
热议问题