From: David Vazquez Date: Wed, 26 Dec 2012 17:31:35 +0000 (+0000) Subject: defvar accepts optional value (it was required) X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=bf064752771392a19508db305ebd72faf2bead8f;p=jscl.git defvar accepts optional value (it was required) --- diff --git a/lispstrack.lisp b/lispstrack.lisp index 79b9b6b..7a771a6 100644 --- a/lispstrack.lisp +++ b/lispstrack.lisp @@ -35,7 +35,7 @@ (%compile-defvar ',name)) (setq ,name ,value))) - (defmacro defvar (name value) + (defmacro defvar (name &optional value) `(%defvar ,name ,value)) (defmacro %defun (name args &rest body) @@ -138,7 +138,7 @@ (%defun ,name ,args ,@body) ',name)) - (defmacro defvar (name value) + (defmacro defvar (name &optional value) `(progn (%defvar ,name ,value) ',name)) @@ -160,11 +160,11 @@ (defun reverse (list) (reverse-aux list '())) - (defmacro incf (x) - `(setq ,x (1+ ,x))) + (defmacro incf (x &optional (delta 1)) + `(setq ,x (+ ,x ,delta))) - (defmacro decf (x) - `(setq ,x (1- ,x))) + (defmacro decf (x &optional (delta 1)) + `(setq ,x (- ,x ,delta))) (defun list-length (list) (let ((l 0))