diff options
| author | Eduardo Julian | 2018-05-06 23:27:12 -0400 | 
|---|---|---|
| committer | Eduardo Julian | 2018-05-06 23:27:12 -0400 | 
| commit | fb72b937aba7886ce204379e97aa06c327a4029f (patch) | |
| tree | 20bc243f1605c5b6c37b833b8046b82eac805494 /new-luxc/source/luxc/lang/translation/js/procedure | |
| parent | 0b53bcc87ad3563daedaa64306d0bbe6df01ca49 (diff) | |
- Implemented Nat functionality in pure Lux.
Diffstat (limited to '')
| -rw-r--r-- | new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux | 45 | 
1 files changed, 4 insertions, 41 deletions
| diff --git a/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux index 14e37efb8..f9e00be2a 100644 --- a/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux @@ -210,9 +210,6 @@       Nullary       (<encode> <const>))] -  [nat//min                 0                           runtimeT.int] -  [nat//max                -1                           runtimeT.int] -    [int//min                Long::MIN_VALUE              runtimeT.int]    [int//max                Long::MAX_VALUE              runtimeT.int] @@ -238,12 +235,6 @@    [int//div        runtimeT.int///]    [int//rem        runtimeT.int//%] -  [nat//add        runtimeT.int//+] -  [nat//sub        runtimeT.int//-] -  [nat//mul        runtimeT.int//*] -  [nat//div        runtimeT.nat///] -  [nat//rem        runtimeT.nat//%] -    [deg//add        runtimeT.int//+]    [deg//sub        runtimeT.int//-]    [deg//mul        runtimeT.deg//*] @@ -275,21 +266,10 @@       Binary       (format <cmp> "(" subjectJS "," paramJS ")"))] -  [nat//= runtimeT.int//=] -  [nat//< runtimeT.nat//<]    [int//= runtimeT.int//=]    [int//< runtimeT.int//<]    [deg//= runtimeT.int//=] -  [deg//< runtimeT.nat//<] -  ) - -(do-template [<name>] -  [(def: (<name> inputJS) -     Unary -     inputJS)] - -  [nat//to-int] -  [int//to-nat] +  [deg//< runtimeT.int//<]    )  (def: (frac//encode inputJS) @@ -314,7 +294,7 @@    [text//hash   runtimeT.text//hash]    ) -(def: (nat//char inputJS) +(def: (int//char inputJS)    Unary    (format "String.fromCharCode" "(" (int//to-frac inputJS) ")")) @@ -479,22 +459,6 @@            (install "arithmetic-right-shift" (binary bit//arithmetic-right-shift))            ))) -(def: nat-procs -  Bundle -  (<| (prefix "nat") -      (|> (dict.new text.Hash<Text>) -          (install "+" (binary nat//add)) -          (install "-" (binary nat//sub)) -          (install "*" (binary nat//mul)) -          (install "/" (binary nat//div)) -          (install "%" (binary nat//rem)) -          (install "=" (binary nat//=)) -          (install "<" (binary nat//<)) -          (install "min" (nullary nat//min)) -          (install "max" (nullary nat//max)) -          (install "to-int" (unary nat//to-int)) -          (install "char" (unary nat//char))))) -  (def: int-procs    Bundle    (<| (prefix "int") @@ -508,8 +472,8 @@            (install "<" (binary int//<))            (install "min" (nullary int//min))            (install "max" (nullary int//max)) -          (install "to-nat" (unary int//to-nat)) -          (install "to-frac" (unary int//to-frac))))) +          (install "to-frac" (unary int//to-frac)) +          (install "char" (unary int//char)))))  (def: deg-procs    Bundle @@ -638,7 +602,6 @@    (<| (prefix "lux")        (|> lux-procs            (dict.merge bit-procs) -          (dict.merge nat-procs)            (dict.merge int-procs)            (dict.merge deg-procs)            (dict.merge frac-procs) | 
