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/scheme/procedure/common.jvm.lux | 37 +++------------------- 1 file changed, 4 insertions(+), 33 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/scheme/procedure/common.jvm.lux') diff --git a/new-luxc/source/luxc/lang/translation/scheme/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/scheme/procedure/common.jvm.lux index cd828e082..67ec0e95c 100644 --- a/new-luxc/source/luxc/lang/translation/scheme/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/scheme/procedure/common.jvm.lux @@ -235,9 +235,6 @@ Nullary (_.int ))] - [nat//min 0] - [nat//max -1] - [int//min ("lux int min")] [int//max ("lux int max")] @@ -266,12 +263,6 @@ [int//div _.quotient] [int//rem _.remainder] - [nat//add _.+] - [nat//sub _.-] - [nat//mul _.*] - [nat//div runtimeT.nat///] - [nat//rem runtimeT.nat//%] - [deg//add _.+] [deg//sub _.-] [deg//rem _.-] @@ -303,14 +294,11 @@ Binary ( paramO subjectO))] - [nat//= _.=] - [nat//< runtimeT.nat//<] - [int//= _.=] [int//< _.<] [deg//= _.=] - [deg//< runtimeT.nat//<] + [deg//< _.<] ) (def: deg//to-frac @@ -321,25 +309,9 @@ (_./ f2^32) (_./ (_.float 1.0))))) -(def: nat//char (|>> (_.apply1 (_.global "integer->char")) +(def: int//char (|>> (_.apply1 (_.global "integer->char")) (_.apply1 (_.global "string")))) -(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 nat//char))))) - (def: int-procs Bundle (<| (prefix "int") @@ -353,8 +325,8 @@ (install "<" (binary int//<)) (install "min" (nullary int//min)) (install "max" (nullary int//max)) - (install "to-nat" (unary id)) - (install "to-frac" (unary (|>> (_./ (_.float 1.0)))))))) + (install "to-frac" (unary (|>> (_./ (_.float 1.0))))) + (install "char" (unary int//char))))) (def: deg-procs Bundle @@ -519,7 +491,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