Add helpers for let handler
This commit is contained in:
parent
1a94093619
commit
f8c1db2192
1 changed files with 20 additions and 0 deletions
|
|
@ -27,6 +27,26 @@
|
|||
"Retreive the handler for the symbol FIRST."
|
||||
(gethash first *form-handlers* *default-handler*))
|
||||
|
||||
(defun binding-to-symbol (binding)
|
||||
(let ((name (safe-first binding)))
|
||||
(cond ((listp name)
|
||||
(assert (eq 'setf (first name)))
|
||||
(check-type (second name) symbol)
|
||||
(second name))
|
||||
(t
|
||||
name))))
|
||||
|
||||
(defmacro with-imposed-bindings (&body body)
|
||||
#-sbcl
|
||||
`(locally ,@body)
|
||||
#+sbcl
|
||||
(destructuring-bind ((binder bindings &rest binder-body))
|
||||
body
|
||||
`(locally
|
||||
(declare (sb-ext:disable-package-locks
|
||||
,@(mapcar 'binding-to-symbol bindings)))
|
||||
(,binder ,bindings ,@binder-body))))
|
||||
|
||||
(defun function-name-p (name)
|
||||
"Return whether NAME is the name of a function."
|
||||
(or (symbolp name)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue