From: David Vazquez Date: Tue, 18 Dec 2012 01:47:52 +0000 (+0000) Subject: OR X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=9e5532f7bf5438d49d0e1ab9dac312a2379a2412;p=jscl.git OR --- diff --git a/test.lisp b/test.lisp index ee7a699..1f12dc5 100644 --- a/test.lisp +++ b/test.lisp @@ -154,6 +154,22 @@ (and ,@(cdr forms)) nil)))) + +(defmacro or (&rest forms) + (cond + ((null forms) + nil) + ((null (cdr forms)) + (car forms)) + (t + `(if ,(car forms) + t + (or ,@(cdr forms)))))) + + +(defun char= (x y) (= x y)) + + ;;;; Reader ;;; It is a basic Lisp reader. It does not use advanced stuff @@ -166,3 +182,6 @@ (defun %peek-char (stream) (and (< (cdr stream) (length (car stream))) (char (car stream) (cdr stream)))) + +(defun whitespacep (ch) + (or (char= ch #\space) (char= ch #\newline) (char= ch #\tab)))