mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 01:21:38 -05:00
Add macro ein:and-let*
This commit is contained in:
parent
2faeb54475
commit
8ebea1b1a7
1 changed files with 13 additions and 0 deletions
|
@ -131,6 +131,19 @@ pair of TO-PYTHON and FROM-PYTHON."
|
|||
`(let ((it ,test))
|
||||
(if it ,(if rest (macroexpand-all `(ein:aand ,@rest)) 'it))))
|
||||
|
||||
(defmacro ein:and-let* (bindings &rest form)
|
||||
"Gauche's `and-let*'."
|
||||
(declare (debug (((symbolp form)) &rest form))
|
||||
(indent 1))
|
||||
(if (null bindings)
|
||||
`(progn ,@form)
|
||||
(let* ((head (car bindings))
|
||||
(tail (cdr bindings))
|
||||
(rest (macroexpand-all `(ein:and-let* ,tail ,@form))))
|
||||
(cond
|
||||
((symbolp head) `(if ,head ,rest))
|
||||
((= (length head) 1) `(if ,(car head) ,rest))
|
||||
(t `(let (,head) (if ,(car head) ,rest)))))))
|
||||
|
||||
(defmacro ein:deflocal (name &optional initvalue docstring)
|
||||
"Define permanent buffer local variable named NAME.
|
||||
|
|
Loading…
Add table
Reference in a new issue