X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=ecmalisp.lisp;h=6c173b942ec5d981444997881d57c05b22797c71;hb=d8cc32ffc4cb6502bd1efe75a49cebf80645b68a;hp=76a189e27d105f0fe39fbde6a48aa9fc7f7c2a53;hpb=e384bdf370e9d17691df25aa4501733e291bdf3a;p=jscl.git 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)))