X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=test.lisp;h=ae8b02d4936cdec20797099740213a01e2a431cf;hb=1f4ae1183098cb793ad02b8aa08301f59488d28a;hp=eff3ac464c5e6cf8bc5c48e2b6559febac60541f;hpb=1eaefd228c8010e2cb9cb73ea62dfeec5ab19053;p=jscl.git diff --git a/test.lisp b/test.lisp index eff3ac4..ae8b02d 100644 --- a/test.lisp +++ b/test.lisp @@ -1,48 +1,5 @@ ;;; Library -(eval-when-compile - (%compile-defmacro 'defmacro - (lambda (name args &rest body) - `(eval-when-compile - (%compile-defmacro ',name (lambda ,args ,@body)))))) - -(defmacro defun (name args &rest body) - `(progn - (eval-when-compile - (%compile-defun ',name)) - (fsetq ,name (lambda ,args ,@body)))) - -(defun + (x y) (+ x y)) -(defun 1+ (x) (+ x 1)) -(defun 1- (x) (- x 1)) - -(defun append (list1 list2) - (if (null list1) - list2 - (cons (car list1) - (append (cdr list1) list2)))) - -(defun reverse-aux (list acc) - (if (null list) - acc - (reverse-aux (cdr list) (cons (car list) acc)))) - -(defun reverse (list) - (reverse-aux list '())) - -(defun mapcar (func list) - (if (null list) - '() - (cons (funcall func (car list)) - (mapcar func (cdr list))))) - -(defun !reduce (func list initial) - (if (null list) - initial - (!reduce func - (cdr list) - (funcall func (car list) initial)))) - ;;; Tests (lambda (x y) x)