From fb72b937aba7886ce204379e97aa06c327a4029f Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 6 May 2018 23:27:12 -0400 Subject: - Implemented Nat functionality in pure Lux. --- .../translation/python/procedure/common.jvm.lux | 36 ++-------------------- 1 file changed, 3 insertions(+), 33 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/python/procedure') diff --git a/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux index c201c417c..69b4aede4 100644 --- a/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux @@ -228,9 +228,6 @@ Nullary ( ))] - [nat//min 0 python.int] - [nat//max -1 python.int] - [frac//smallest Double::MIN_VALUE python.float] [frac//min (f/* -1.0 Double::MAX_VALUE) python.float] [frac//max Double::MAX_VALUE python.float] @@ -269,10 +266,6 @@ [int//sub python.-] [int//mul python.*] - [nat//add python.+] - [nat//sub python.-] - [nat//mul python.*] - [deg//add python.+] [deg//sub python.-] [deg//rem python.-] @@ -288,9 +281,6 @@ [int//div python./] [int//rem python.%] - [nat//div runtimeT.nat///] - [nat//rem runtimeT.nat//%] - [deg//mul runtimeT.deg//*] [deg//div runtimeT.deg///] [deg//reciprocal python./] @@ -318,14 +308,11 @@ Binary ( paramO subjectO))] - [nat//= python.=] - [nat//< runtimeT.nat//<] - [int//= python.=] [int//< python.<] [deg//= python.=] - [deg//< runtimeT.nat//<] + [deg//< python.<] ) (def: (apply1 func) @@ -347,22 +334,6 @@ (python.global "float"))] ) -(def: nat-procs - Bundle - (<| (prefix "nat") - (|> (dict.new text.Hash) - (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 id)) - (install "char" (unary (apply1 (python.global "chr"))))))) - (def: int-procs Bundle (<| (prefix "int") @@ -376,8 +347,8 @@ (install "<" (binary int//<)) (install "min" (nullary int//min)) (install "max" (nullary int//max)) - (install "to-nat" (unary id)) - (install "to-frac" (unary (apply1 (python.global "float"))))))) + (install "to-frac" (unary (apply1 (python.global "float")))) + (install "char" (unary (apply1 (python.global "chr"))))))) (def: deg-procs Bundle @@ -558,7 +529,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) -- cgit v1.2.3