From: David Vázquez Date: Mon, 6 May 2013 12:23:11 +0000 (+0100) Subject: value argument is optional in defvar X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=aef5df75dde094072f75f1f88e13c34710dc7a86;p=jscl.git value argument is optional in defvar --- diff --git a/src/boot.lisp b/src/boot.lisp index 3ba4fda..ccb6f9b 100644 --- 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))