From 748c868680683df1949f62aac274040ac5bf43da Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 30 Jul 2018 23:40:48 -0400 Subject: Now implementing math functionality in stdlib instead of the compiler. --- .../default/phase/analysis/procedure/common.lux | 31 ---------------------- stdlib/test/test/lux/math.lux | 15 ++++++----- 2 files changed, 8 insertions(+), 38 deletions(-) (limited to 'stdlib/test') diff --git a/stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux b/stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux index 5fc04278b..8d3e8b8fa 100644 --- a/stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux +++ b/stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux @@ -207,37 +207,6 @@ (` ("lux array size" (~ g!array))))) )))) -(context: "Math procedures" - (<| (times 100) - (do @ - [subjectC (|> r.frac (:: @ map code.frac)) - paramC (|> r.frac (:: @ map code.frac))] - (`` ($_ seq - (~~ (do-template [ ] - [(test (format "Can calculate " ".") - (check-success+ (list subjectC) Frac))] - - ["lux math cos" "cosine"] - ["lux math sin" "sine"] - ["lux math tan" "tangent"] - ["lux math acos" "inverse/arc cosine"] - ["lux math asin" "inverse/arc sine"] - ["lux math atan" "inverse/arc tangent"] - ["lux math cosh" "hyperbolic cosine"] - ["lux math sinh" "hyperbolic sine"] - ["lux math tanh" "hyperbolic tangent"] - ["lux math exp" "exponentiation"] - ["lux math log" "logarithm"] - ["lux math ceil" "ceiling"] - ["lux math floor" "floor"] - ["lux math round" "rounding"])) - (~~ (do-template [ ] - [(test (format "Can calculate " ".") - (check-success+ (list subjectC paramC) Frac))] - - ["lux math atan2" "inverse/arc tangent (with 2 arguments)"] - ["lux math pow" "power"]))))))) - (context: "Atom procedures" (<| (times 100) (do @ diff --git a/stdlib/test/test/lux/math.lux b/stdlib/test/test/lux/math.lux index 4cdb8eed5..059f19c4c 100644 --- a/stdlib/test/test/lux/math.lux +++ b/stdlib/test/test/lux/math.lux @@ -6,6 +6,7 @@ [bit ("bit/." Equivalence)] [number ("frac/." Number)]] ["&" math + infix ["r" random]]] lux/test) @@ -98,27 +99,27 @@ ($_ seq (test "Constant values don't change." (n/= x - (&.infix x))) + (infix x))) (test "Can call binary functions." (n/= (&.n/gcd y x) - (&.infix [x &.n/gcd y]))) + (infix [x &.n/gcd y]))) (test "Can call unary functions." (f/= (&.sin theta) - (&.infix [&.sin theta]))) + (infix [&.sin theta]))) (test "Can use regular syntax in the middle of infix code." (n/= (&.n/gcd 450 (n/* 3 9)) - (&.infix [(n/* 3 9) &.n/gcd 450]))) + (infix [(n/* 3 9) &.n/gcd 450]))) (test "Can use non-numerical functions/macros as operators." (bit/= (and (n/< y x) (n/< z y)) - (&.infix [[x n/< y] and [y n/< z]]))) + (infix [[x n/< y] and [y n/< z]]))) (test "Can combine bit operations in special ways via special keywords." (and (bit/= (and (n/< y x) (n/< z y)) - (&.infix [#and x n/< y n/< z])) + (infix [#and x n/< y n/< z])) (bit/= (and (n/< y x) (n/> z y)) - (&.infix [#and x n/< y n/> z])))) + (infix [#and x n/< y n/> z])))) )))) -- cgit v1.2.3