From bf064752771392a19508db305ebd72faf2bead8f Mon Sep 17 00:00:00 2001 From: David Vazquez Date: Wed, 26 Dec 2012 17:31:35 +0000 Subject: [PATCH] defvar accepts optional value (it was required) --- lispstrack.lisp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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)) -- 1.7.10.4