X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=ecmalisp.lisp;h=d015254570b5531a763da031f01eb46881117707;hb=0294dcffc8c3a9f7bd0a2c5242a091fc33cbcc6e;hp=81c77965f2c1e1c63ad9f28d6cdf63c0ff18c6b9;hpb=6268da695882c28506305e83b9fd2536e45473e3;p=jscl.git diff --git a/ecmalisp.lisp b/ecmalisp.lisp index 81c7796..d015254 100644 --- a/ecmalisp.lisp +++ b/ecmalisp.lisp @@ -98,8 +98,6 @@ ;; Basic functions (defun = (x y) (= x y)) - (defun + (x y) (+ x y)) - (defun - (x y) (- x y)) (defun * (x y) (* x y)) (defun / (x y) (/ x y)) (defun 1+ (x) (+ x 1)) @@ -249,6 +247,18 @@ ;;; constructions. #+ecmalisp (progn + (defun + (&rest args) + (let ((r 0)) + (dolist (x args r) + (incf r x)))) + + (defun - (x &rest others) + (if (null others) + (- x) + (let ((r x)) + (dolist (y others r) + (decf r y))))) + (defun append-two (list1 list2) (if (null list1) list2