From: David Vázquez Date: Wed, 16 Jan 2013 17:18:45 +0000 (+0000) Subject: Add: DEFPARAMETER X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=d8cc32ffc4cb6502bd1efe75a49cebf80645b68a;p=jscl.git Add: DEFPARAMETER --- diff --git a/ecmalisp.lisp b/ecmalisp.lisp index 76a189e..6c173b9 100644 --- a/ecmalisp.lisp +++ b/ecmalisp.lisp @@ -38,8 +38,23 @@ ,@body))) ',name)))) + (setq nil 'nil) + (setq t 't) + + (defmacro when (condition &body body) + `(if ,condition (progn ,@body) nil)) + + (defmacro unless (condition &body body) + `(if ,condition nil (progn ,@body))) + (defmacro defvar (name value) `(progn + (unless (boundp ',name) + (setq ,name ,value)) + ',name)) + + (defmacro defparameter (name value) + `(progn (setq ,name ,value) ',name)) @@ -57,9 +72,6 @@ (defvar *package* (new)) - (defvar nil 'nil) - (defvar t 't) - (defun null (x) (eq x nil)) @@ -131,12 +143,6 @@ (defmacro push (x place) `(setq ,place (cons ,x ,place))) - (defmacro when (condition &body body) - `(if ,condition (progn ,@body) nil)) - - (defmacro unless (condition &body body) - `(if ,condition nil (progn ,@body))) - (defmacro dolist (iter &body body) (let ((var (first iter)) (g!list (gensym)))