Relocated the definitions for the 1+ and 1- psmacros with the other math functions.
authorTravis Cross <tc@traviscross.com>
Tue, 1 Apr 2008 08:18:01 +0000 (08:18 +0000)
committerTravis Cross <tc@traviscross.com>
Tue, 1 Apr 2008 08:18:01 +0000 (08:18 +0000)
src/lib/ps-macro-lib.lisp
src/special-forms.lisp

index f1f73f0..a38b4e8 100644 (file)
@@ -29,6 +29,8 @@
     (asinh (n) `((lambda (x) (return (log (+ x (sqrt (1+ (* x x))))))) ,n))
     (acosh (n) `((lambda (x) (return (* 2 (log (+ (sqrt (/ (1+ x) 2)) (sqrt (/ (1- x) 2))))))) ,n))
     (atanh (n) `((lambda (x) (return (/ (- (log (+ 1 x)) (log (- 1 x))) 2))) ,n))
+    (1+ (n) `(+ ,n 1))
+    (1- (n) `(- ,n 1))
     (abs (n) `(*math.abs ,n))
     (evenp (n) `(not (oddp ,n)))
     (oddp (n) `(% ,n 2))
index e07d331..26f787c 100644 (file)
   (declare (ignore expecting))
   (list 'unary-operator "~" (compile-parenscript-form x :expecting :expression) :prefix t))
 
-(defpsmacro 1- (form)
-  `(- ,form 1))
-
-(defpsmacro 1+ (form)
-  `(+ ,form 1))
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; control structures
 (defun flatten-blocks (body)