(defun boundp (x)
(boundp x))
+(defun fboundp (x)
+ (fboundp x))
+
;; Basic functions
(defun = (x y) (= x y))
(defun * (x y) (* x y))
(defun char= (x y)
(eql x y))
+(defun char< (x y)
+ (< (char-code x) (char-code y)))
+
(defun integerp (x)
(and (numberp x) (= (floor x) x)))
(defun alpha-char-p (x)
(or (<= (char-code #\a) (char-code x) (char-code #\z))
- (<= (char-code #\Z) (char-code x) (char-code #\Z))))
+ (<= (char-code #\A) (char-code x) (char-code #\Z))))
(defun digit-char-p (x)
(if (and (<= (char-code #\0) (char-code x) (char-code #\9)))
(and (<= 0 weight 9)
(char "0123456789" weight)))
-(defun subseq (seq a &optional b)
- (if b
- (slice seq a b)
- (slice seq a)))
-
-(defmacro do-sequence (iteration &body body)
- (let ((seq (gensym))
- (index (gensym)))
- `(let ((,seq ,(second iteration)))
- (cond
- ;; Strings
- ((stringp ,seq)
- (let ((,index 0))
- (dotimes (,index (length ,seq))
- (let ((,(first iteration)
- (char ,seq ,index)))
- ,@body))))
- ;; Lists
- ((listp ,seq)
- (dolist (,(first iteration) ,seq)
- ,@body))
- (t
- (error "type-error!"))))))
-
(defun equal (x y)
(cond
((eql x y) t)
(defun error (fmt &rest args)
(%throw (apply #'format nil fmt args)))
-