From aef5df75dde094072f75f1f88e13c34710dc7a86 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Mon, 6 May 2013 13:23:11 +0100 Subject: [PATCH] value argument is optional in defvar --- src/boot.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)) -- 1.7.10.4