emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Keyword args (was: Return)


From: MON KEY
Subject: Keyword args (was: Return)
Date: Sat, 11 Dec 2010 23:49:03 -0500

> Since we have destructuring-bind parsing plists is not very hard.

No, we have _some_ of dbind...

Following is the CL specs cannonical `destructuring-bind' example:

,----
|
| Examples:
|
|  (defun iota (n) (loop for i from 1 to n collect i))       ;helper
|
|  (destructuring-bind ((a &optional (b 'bee)) one two three)
|      `((alpha) ,@(iota 3))
|    (list a b three two one)) → (ALPHA BEE 3 2 1)
|
`----

Does evaluating the above two forms in elisp land you in *Backtrace*
with something like this at beginning-of-buffer:

 Debugger entered--Lisp error: (void-variable bind-enquote)

If so, I would argue that the current elisp's implementation fo
`destructuring-bind' isn't exactly the panacea to keyword parsing you
claim it is.

By way of comparison this is what a recent SBCL returns:

CL-USER> (format nil "~a ~a" (lisp-implementation-type)
                             (lisp-implementation-version))
;=> "SBCL 1.0.45.3"

CL-USER> (defun iota (n) (loop for i from 1 to n collect i))
;=> IOTA

CL-USER> (destructuring-bind ((a &optional (b 'bee)) one two three)
             `((alpha) ,@(iota 3))
           (list a b three two one))
;=> (ALPHA BEE 3 2 1)

--
/s_P\



reply via email to

[Prev in Thread] Current Thread [Next in Thread]