21 May 2008 03:34
destructuring-bind <symbol>
Dan Bensen <dsb <at> prairienet.org>
2008-05-21 01:34:59 GMT
2008-05-21 01:34:59 GMT
There seems to be some inconsistency between sbcl, acl, and the hyperspec in applying destructuring-bind to a bare variable. There's a comp.lang.lisp thread about it here: http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/92a6b55c17a65bea# Briefly, sbcl generates a (type list) declaration along with binding the variable, acl justs binds it, and the HS says the first arg is supposed to be a lambda list, which seems to rule out a (non-nil) symbol. Here are the expansions and the definition: acl: CL-USER(1): (macroexpand-1 '(destructuring-bind x 1 x)) (LET* () (LET* ((#:G6 1) (X #:G6)) X)) sbcl: CL-USER> (macroexpand-1 '(destructuring-bind x 1 x)) (LET ((#:WHOLE2137 1)) (DECLARE (TYPE LIST #:WHOLE2137)) (LET* () (LET* ((X #:WHOLE2137)) X))) hyperspec: destructuring-bind lambda-list expression declaration* form* lambda-list::= (wholevar reqvars optvars restvar keyvars auxvars)(Continue reading)
RSS Feed