diff options
author | Eduardo Julian | 2017-11-27 02:09:04 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-11-27 02:09:04 -0400 |
commit | d6a7a133c5c4a734ab45e9497c8e5df749ce383a (patch) | |
tree | 040b4df12dd3482fc0bb76f8e0a37126ef34fb34 /stdlib/test/test/lux.lux | |
parent | 6031fc715b4a16b008d6f288c38739d9bb066490 (diff) |
- Changed the prefixes of numeric functions.
Diffstat (limited to '')
-rw-r--r-- | stdlib/test/test/lux.lux | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/stdlib/test/test/lux.lux b/stdlib/test/test/lux.lux index addc7a33a..d73f0c5a9 100644 --- a/stdlib/test/test/lux.lux +++ b/stdlib/test/test/lux.lux @@ -14,7 +14,7 @@ (context: "Value identity." (<| (times +100) (do @ - [size (|> r;nat (:: @ map (|>. (n.% +100) (n.max +10)))) + [size (|> r;nat (:: @ map (|>. (n/% +100) (n/max +10)))) x (r;text size) y (r;text size)] ($_ seq @@ -52,8 +52,8 @@ (and (|> value inc even?) (|> value dec even?)))))))] - ["Nat" r;nat n.inc n.dec n.even? n.odd? n.= n.< n.>] - ["Int" r;int i.inc i.dec i.even? i.odd? i.= i.< i.>] + ["Nat" r;nat n/inc n/dec n/even? n/odd? n/= n/< n/>] + ["Int" r;int i/inc i/dec i/even? i/odd? i/= i/< i/>] ) (do-template [category rand-gen = < > <= >= min max] @@ -80,10 +80,10 @@ (>= y (max x y))) )))))] - ["Int" r;int i.= i.< i.> i.<= i.>= i.min i.max] - ["Nat" r;nat n.= n.< n.> n.<= n.>= n.min n.max] - ["Frac" r;frac f.= f.< f.> f.<= f.>= f.min f.max] - ["Deg" r;deg d.= d.< d.> d.<= d.>= d.min d.max] + ["Int" r;int i/= i/< i/> i/<= i/>= i/min i/max] + ["Nat" r;nat n/= n/< n/> n/<= n/>= n/min n/max] + ["Frac" r;frac f/= f/< f/> f/<= f/>= f/min f/max] + ["Deg" r;deg d/= d/< d/> d/<= d/>= d/min d/max] ) (do-template [category rand-gen = + - * / <%> > <0> <1> <factor> %x <cap> <prep>] @@ -136,10 +136,10 @@ (|> x' (/ y) (* y) (= x')))) ))))] - ["Nat" r;nat n.= n.+ n.- n.* n./ n.% n.> +0 +1 +1000000 %n (n.% +1000) id] - ["Int" r;int i.= i.+ i.- i.* i./ i.% i.> 0 1 1000000 %i (i.% 1000) id] - ["Frac" r;frac f.= f.+ f.- f.* f./ f.% f.> 0.0 1.0 1000000.0 %r id math;floor] - ["Deg" r;deg d.= d.+ d.- d.* d./ d.% d.> .0 ("lux deg max") ("lux deg max") %f id id] + ["Nat" r;nat n/= n/+ n/- n/* n// n/% n/> +0 +1 +1000000 %n (n/% +1000) id] + ["Int" r;int i/= i/+ i/- i/* i// i/% i/> 0 1 1000000 %i (i/% 1000) id] + ["Frac" r;frac f/= f/+ f/- f/* f// f/% f/> 0.0 1.0 1000000.0 %r id math;floor] + ["Deg" r;deg d/= d/+ d/- d/* d// d/% d/> .0 ("lux deg max") ("lux deg max") %f id id] ) (do-template [category rand-gen -> <- = <cap> %a %z] @@ -151,21 +151,21 @@ (test "" (|> value -> <- (= value))))))] - ["Int->Nat" r;int int-to-nat nat-to-int i.= (i.% 1000000) %i %n] - ["Nat->Int" r;nat nat-to-int int-to-nat n.= (n.% +1000000) %n %i] - ["Int->Frac" r;int int-to-frac frac-to-int i.= (i.% 1000000) %i %r] - ["Frac->Int" r;frac frac-to-int int-to-frac f.= math;floor %r %i] - ## [r;frac frac-to-deg deg-to-frac f.= (f.% 1.0) %r %f] + ["Int->Nat" r;int int-to-nat nat-to-int i/= (i/% 1000000) %i %n] + ["Nat->Int" r;nat nat-to-int int-to-nat n/= (n/% +1000000) %n %i] + ["Int->Frac" r;int int-to-frac frac-to-int i/= (i/% 1000000) %i %r] + ["Frac->Int" r;frac frac-to-int int-to-frac f/= math;floor %r %i] + ## [r;frac frac-to-deg deg-to-frac f/= (f/% 1.0) %r %f] ) (context: "Simple macros and constructs" ($_ seq (test "Can write easy loops for iterative programming." - (i.= 1000 + (i/= 1000 (loop [counter 0 value 1] - (if (i.< 3 counter) - (recur (i.inc counter) (i.* 10 value)) + (if (i/< 3 counter) + (recur (i/inc counter) (i/* 10 value)) value)))) (test "Can create lists easily through macros." @@ -192,7 +192,7 @@ )) (template: (hypotenuse x y) - (i.+ (i.* x x) (i.* y y))) + (i/+ (i/* x x) (i/* y y))) (context: "Templates." (<| (times +100) @@ -200,7 +200,7 @@ [x r;int y r;int] (test "Template application is a stand-in for the templated code." - (i.= (i.+ (i.* x x) (i.* y y)) + (i/= (i/+ (i/* x x) (i/* y y)) (hypotenuse x y)))))) (context: "Cross-platform support." |