projects
/
jscl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
84897ab
)
value argument is optional in defvar
author
David Vázquez
<davazp@gmail.com>
Mon, 6 May 2013 12:23:11 +0000
(13:23 +0100)
committer
David Vázquez
<davazp@gmail.com>
Mon, 6 May 2013 12:23:11 +0000
(13:23 +0100)
src/boot.lisp
patch
|
blob
|
history
diff --git
a/src/boot.lisp
b/src/boot.lisp
index
3ba4fda
..
ccb6f9b
100644
(file)
--- a/
src/boot.lisp
+++ b/
src/boot.lisp
@@
-60,10
+60,10
@@
(defmacro unless (condition &body body)
`(if ,condition nil (progn ,@body)))
-(defmacro defvar (name value &optional docstring)
+(defmacro defvar (name &optional (value nil value-p) docstring)
`(progn
(declaim (special ,name))
- (unless (boundp ',name) (setq ,name ,value))
+ ,@(when value-p `((unless (boundp ',name) (setq ,name ,value))))
,@(when (stringp docstring) `((oset ',name "vardoc" ,docstring)))
',name))