mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 05:25:28 +03:00
Generics no longer propagated.
This commit is contained in:
parent
08af49dc62
commit
99516122b1
@ -39,11 +39,9 @@ The margin of error is 0.00001.")
|
||||
|
||||
)
|
||||
|
||||
|
||||
(with Generics
|
||||
;; These are defined in the global scope.
|
||||
|
||||
(use Generics)
|
||||
|
||||
(defn <= [a b]
|
||||
(or (< a b)
|
||||
(= a b)))
|
||||
@ -104,3 +102,5 @@ The margin of error is 0.00001.")
|
||||
|
||||
(defn random--1-1 []
|
||||
(random-between (minus-one) (one)))
|
||||
|
||||
)
|
@ -1,9 +1,9 @@
|
||||
(defmodule Geometry
|
||||
(doc degree-to-radians "converts degrees expressed as a double `n` into radians.")
|
||||
(defn degree-to-radians [n]
|
||||
(* n (/ pi (one-hundred-eighty))))
|
||||
(* n (/ pi (Generics.one-hundred-eighty))))
|
||||
|
||||
(doc radians-to-degree "converts radians expressed as a double `n` into degrees.")
|
||||
(defn radians-to-degree [n]
|
||||
(* n (/ (one-hundred-eighty) pi)))
|
||||
(* n (/ (Generics.one-hundred-eighty) pi)))
|
||||
)
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
(doc vapprox "Check whether the vectors a and b are approximately equal.")
|
||||
(defn vapprox [a b]
|
||||
(vreduce (fn [i v] (and i v)) true &(zip approx a b)))
|
||||
(vreduce (fn [i v] (and i v)) true &(zip Generics.approx a b)))
|
||||
|
||||
(defn sum [o]
|
||||
(vreduce + (zero) o))
|
||||
@ -94,7 +94,7 @@
|
||||
|
||||
(doc perpendicular? "Check whether the two vectors a and b are perpendicular.")
|
||||
(defn perpendicular? [a b]
|
||||
(= (angle-between a b) (half-pi)))
|
||||
(= (angle-between a b) (Generics.half-pi)))
|
||||
|
||||
(doc vlerp "Linearly interpolate between the two vectors a and b by amnt (between 0 and 1).")
|
||||
(defn vlerp [a b amnt]
|
||||
@ -131,7 +131,7 @@
|
||||
|
||||
(doc vapprox "Check whether the vectors a and b are approximately equal.")
|
||||
(defn vapprox [a b]
|
||||
(vreduce (fn [i v] (and i v)) true &(zip approx a b)))
|
||||
(vreduce (fn [i v] (and i v)) true &(zip Generics.approx a b)))
|
||||
|
||||
(defn add [a b]
|
||||
(zip + a b))
|
||||
@ -203,7 +203,7 @@
|
||||
|
||||
(doc perpendicular? "Check whether the two vectors a and b are perpendicular.")
|
||||
(defn perpendicular? [a b]
|
||||
(= (angle-between a b) (half-pi)))
|
||||
(= (angle-between a b) (Generics.half-pi)))
|
||||
|
||||
(doc vlerp "Linearly interpolate between the two vectors a and b by amnt (between 0 and 1).")
|
||||
(defn vlerp [a b amnt]
|
||||
@ -294,7 +294,7 @@
|
||||
|
||||
(doc perpendicular? "Check whether the two vectors a and b are perpendicular.")
|
||||
(defn perpendicular? [a b]
|
||||
(Maybe.apply (angle-between a b) (fn [x] (= x (half-pi)))))
|
||||
(Maybe.apply (angle-between a b) (fn [x] (= x (Generics.half-pi)))))
|
||||
|
||||
(doc vlerp "Linearly interpolate between the two vectors a and b by amnt (between 0 and 1).")
|
||||
(defn vlerp [a b amnt]
|
||||
|
Loading…
Reference in New Issue
Block a user