Lacking Natural Simplicity

Random musings on books, code, and tabletop games.

Binding a symbol defined with DEFCONSTANT with LET is not portable in Common Lisp

SBCL and CCL and CLISP think binding a symbol defined with defconstant is an error, so if you do

(defconstant foo "foo")
(let ((foo "bar")) foo)

you get an error. But in ABCL and ECL you don’t.

If you try

(defun x () (let ((foo "bar")) foo))

in SBCL and CCL you get an error when the function is compiled. In SBCL the function is defined, but always gives an error when run. In CCL the function does not get defined.

Print Friendly and PDF

Comments

Comments powered by Disqus