small fixes in stdlib
This commit is contained in:
+5
-6
@@ -1,18 +1,17 @@
|
||||
(define-module math
|
||||
:imports ("oo.slime")
|
||||
:exports (pi abs sqrt make-vector3)
|
||||
|
||||
(import "oo.slime")
|
||||
|
||||
(define pi
|
||||
"Tha famous circle constant."
|
||||
:doc "Tha famous circle constant."
|
||||
3.14159265)
|
||||
|
||||
(define (abs x)
|
||||
"Accepts one argument and returns the absoulte value of it"
|
||||
:doc "Accepts one argument and returns the absoulte value of it"
|
||||
(if (> x 0) x (- x)))
|
||||
|
||||
(define (sqrt x)
|
||||
"Accepts one argument and returns the square root of it"
|
||||
:doc "Accepts one argument and returns the square root of it"
|
||||
(** x 0.5))
|
||||
|
||||
(define-class (vector3 x y z)
|
||||
@@ -58,4 +57,4 @@
|
||||
(- (* (-> other y) x) (* (-> other x) y))))
|
||||
|
||||
(define (print)
|
||||
(printf :sep "" "[vector3] (" x " " y " " z ")"))))
|
||||
(print :sep "" "[vector3] (" x " " y " " z ")"))))
|
||||
|
||||
Reference in New Issue
Block a user