Rearranged math psmacros to match the order that the corresponding functions appear...
authorTravis Cross <tc@traviscross.com>
Mon, 31 Mar 2008 23:03:58 +0000 (23:03 +0000)
committerTravis Cross <tc@traviscross.com>
Mon, 31 Mar 2008 23:03:58 +0000 (23:03 +0000)
src/lib/ps-macro-lib.lisp

index ee720bf..2cc3c35 100644 (file)
   `(progn ,@(mapcar (lambda (def) (cons 'defpsmacro def)) mathdefs)))
 
 (def-js-maths
-    (min (&rest nums) `(*math.min ,@nums))
     (max (&rest nums) `(*math.max ,@nums))
+    (min (&rest nums) `(*math.min ,@nums))
+    (floor (n &optional divisor) `(*math.floor ,(if divisor `(/ ,n ,divisor) n)))
     (ceiling (n &optional divisor) `(*math.ceil ,(if divisor `(/ ,n ,divisor) n)))
-    (abs (n) `(*math.abs ,n))
+    (round (n &optional divisor) `(*math.round ,(if divisor `(/ ,n ,divisor) n)))
     (sin (n) `(*math.sin ,n))
     (cos (n) `(*math.cos ,n))
     (tan (n) `(*math.tan ,n))
-    (acos (n) `(*math.acos ,n))
     (asin (n) `(*math.asin ,n))
+    (acos (n) `(*math.acos ,n))
     (atan (y &optional x) (if x `(*math.atan2 ,y ,x) `(*math.atan ,y)))
+    (abs (n) `(*math.abs ,n))
+    (evenp (n) `(not (oddp ,n)))
+    (oddp (n) `(% ,n 2))
     (exp (n) `(*math.exp ,n))
+    (expt (base power) `(*math.pow ,base ,power))
     (log (n &optional base)
       (or (and (null base) `(*math.log ,n))
           (and (numberp base) (= base 10) `(* (log ,n) *math.*log10e*))
           `(/ (log ,n) (log ,base))))
-    (floor (n &optional divisor) `(*math.floor ,(if divisor `(/ ,n ,divisor) n)))
-    (expt (base power) `(*math.pow ,base ,power))
     (sqrt (n) `(*math.sqrt ,n))
-    (round (n &optional divisor) `(*math.round ,(if divisor `(/ ,n ,divisor) n)))
     (random (&optional upto) (if upto
                                  `(floor (* ,upto (*math.random)))
-                                 '(*math.random)))
-    (oddp (n) `(% ,n 2))
-    (evenp (n) `(not (oddp ,n))))
+                                 '(*math.random))))
 
 ;;; Exception handling