From 428965131e17d101a16e3ca60b3412101e216cd1 Mon Sep 17 00:00:00 2001
From: Eduardo Julian
Date: Tue, 31 Jul 2018 22:54:35 -0400
Subject: Now implementing box functionality in stdlib instead of the compiler.

---
 .../common-lisp/procedure/common.jvm.lux           | 22 --------------
 .../lang/translation/js/procedure/common.jvm.lux   | 22 --------------
 .../lang/translation/jvm/procedure/common.jvm.lux  | 34 ----------------------
 .../lang/translation/lua/procedure/common.jvm.lux  | 22 --------------
 .../translation/python/procedure/common.jvm.lux    | 22 --------------
 .../lang/translation/r/procedure/common.jvm.lux    | 22 --------------
 .../lang/translation/ruby/procedure/common.jvm.lux | 22 --------------
 7 files changed, 166 deletions(-)

(limited to 'new-luxc/source')

diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux
index 91a95d2f9..b140a11eb 100644
--- a/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux
@@ -301,27 +301,6 @@
           (install "exit" (unary runtimeT.io//exit))
           (install "current-time" (nullary (function (_ _) (runtimeT.io//current-time runtimeT.unit)))))))
 
-## [[Box]]
-(def: box//new
-  Unary
-  (|>> (list) _.vector))
-
-(def: (box//read box)
-  Unary
-  (_.svref box (_.int 0)))
-
-(def: (box//write [valueO boxO])
-  Binary
-  (runtimeT.box//write valueO boxO))
-
-(def: box-procs
-  Bundle
-  (<| (prefix "box")
-      (|> (dict.new text.Hash<Text>)
-          (install "new" (unary box//new))
-          (install "read" (unary box//read))
-          (install "write" (binary box//write)))))
-
 ## [Bundles]
 (def: #export procedures
   Bundle
@@ -332,5 +311,4 @@
           (dict.merge frac-procs)
           (dict.merge text-procs)
           (dict.merge io-procs)
-          (dict.merge box-procs)
           )))
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 0efdedd4c..641eb9e02 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
@@ -286,19 +286,6 @@
   Nullary
   (frac//to-int "(new Date()).getTime()"))
 
-## [[Box]]
-(def: (box//new initJS)
-  Unary
-  (format "[" initJS "]"))
-
-(def: (box//read boxJS)
-  Unary
-  (format "(" boxJS ")[0]"))
-
-(def: (box//write [valueJS boxJS])
-  Binary
-  (void (format (box//read boxJS) " = " valueJS)))
-
 ## [Bundles]
 (def: lux-procs
   Bundle
@@ -376,14 +363,6 @@
           (install "exit" (unary io//exit))
           (install "current-time" (nullary io//current-time)))))
 
-(def: box-procs
-  Bundle
-  (<| (prefix "box")
-      (|> (dict.new text.Hash<Text>)
-          (install "new" (unary box//new))
-          (install "read" (unary box//read))
-          (install "write" (binary box//write)))))
-
 (def: #export procedures
   Bundle
   (<| (prefix "lux")
@@ -393,5 +372,4 @@
           (dict.merge frac-procs)
           (dict.merge text-procs)
           (dict.merge io-procs)
-          (dict.merge box-procs)
           )))
diff --git a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
index 2c470c44c..809a13bb9 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
@@ -364,31 +364,6 @@
   (|>> (_.INVOKESTATIC "java.lang.System" "currentTimeMillis" ($t.method (list) (#.Some $t.long) (list)) #0)
        (_.wrap #$.Long)))
 
-## [[Box]]
-(def: empty-boxI
-  $.Inst
-  (|>> (_.int 1) (_.ANEWARRAY ($t.binary-name "java.lang.Object"))))
-
-(def: check-boxI
-  $.Inst
-  (_.CHECKCAST ($t.descriptor $Object-Array)))
-
-(def: (box//new initI)
-  Unary
-  (|>> empty-boxI
-       _.DUP (_.int 0) initI _.AASTORE))
-
-(def: (box//read boxI)
-  Unary
-  (|>> boxI check-boxI
-       (_.int 0) _.AALOAD))
-
-(def: (box//write [valueI boxI])
-  Binary
-  (|>> boxI check-boxI
-       (_.int 0) valueI _.AASTORE
-       unitI))
-
 ## [Bundles]
 (def: lux-procs
   Bundle
@@ -466,14 +441,6 @@
           (install "exit" (unary io//exit))
           (install "current-time" (nullary io//current-time)))))
 
-(def: box-procs
-  Bundle
-  (<| (prefix "box")
-      (|> (dict.new text.Hash<Text>)
-          (install "new" (unary box//new))
-          (install "read" (unary box//read))
-          (install "write" (binary box//write)))))
-
 (def: #export procedures
   Bundle
   (<| (prefix "lux")
@@ -483,5 +450,4 @@
           (dict.merge frac-procs)
           (dict.merge text-procs)
           (dict.merge io-procs)
-          (dict.merge box-procs)
           )))
diff --git a/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux
index 394dd3d34..f173f24b6 100644
--- a/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux
@@ -285,19 +285,6 @@
   (|> (lua.apply "os.time" (list))
       (lua.* (lua.int 1_000))))
 
-## [[Box]]
-(def: box//new
-  Unary
-  (|>> (list) lua.array))
-
-(def: box//read
-  Unary
-  (lua.nth (lua.int 1)))
-
-(def: (box//write [valueO boxO])
-  Binary
-  (runtimeT.box//write valueO boxO))
-
 ## [Bundles]
 (def: lux-procs
   Bundle
@@ -375,14 +362,6 @@
           (install "exit" (unary io//exit))
           (install "current-time" (nullary io//current-time)))))
 
-(def: box-procs
-  Bundle
-  (<| (prefix "box")
-      (|> (dict.new text.Hash<Text>)
-          (install "new" (unary box//new))
-          (install "read" (unary box//read))
-          (install "write" (binary box//write)))))
-
 (def: #export procedures
   Bundle
   (<| (prefix "lux")
@@ -392,5 +371,4 @@
           (dict.merge frac-procs)
           (dict.merge text-procs)
           (dict.merge io-procs)
-          (dict.merge box-procs)
           )))
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 430d4b5e7..8ffe03f49 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
@@ -328,27 +328,6 @@
           (install "current-time" (nullary (function (_ _)
                                              (runtimeT.io//current-time! runtimeT.unit)))))))
 
-## [[Box]]
-(def: box//new
-  Unary
-  (|>> (list) python.list))
-
-(def: box//read
-  Unary
-  (python.nth (python.int 0)))
-
-(def: (box//write [valueO boxO])
-  Binary
-  (runtimeT.box//write valueO boxO))
-
-(def: box-procs
-  Bundle
-  (<| (prefix "box")
-      (|> (dict.new text.Hash<Text>)
-          (install "new" (unary box//new))
-          (install "read" (unary box//read))
-          (install "write" (binary box//write)))))
-
 ## [Bundles]
 (def: #export procedures
   Bundle
@@ -359,5 +338,4 @@
           (dict.merge frac-procs)
           (dict.merge text-procs)
           (dict.merge io-procs)
-          (dict.merge box-procs)
           )))
diff --git a/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux
index 421618890..261e6cfb9 100644
--- a/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux
@@ -326,27 +326,6 @@
           (install "current-time" (nullary (function (_ _)
                                              (runtimeT.io//current-time! runtimeT.unit)))))))
 
-## [[Box]]
-(def: box//new
-  Unary
-  (|>> (list) r.list))
-
-(def: box//read
-  Unary
-  (r.nth (r.int 1)))
-
-(def: (box//write [valueO boxO])
-  Binary
-  (runtimeT.box//write valueO boxO))
-
-(def: box-procs
-  Bundle
-  (<| (prefix "box")
-      (|> (dict.new text.Hash<Text>)
-          (install "new" (unary box//new))
-          (install "read" (unary box//read))
-          (install "write" (binary box//write)))))
-
 ## [Bundles]
 (def: #export procedures
   Bundle
@@ -357,5 +336,4 @@
           (dict.merge frac-procs)
           (dict.merge text-procs)
           (dict.merge io-procs)
-          (dict.merge box-procs)
           )))
diff --git a/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux
index e40f49b80..9176879b1 100644
--- a/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux
@@ -359,27 +359,6 @@
           (install "exit" (unary io//exit))
           (install "current-time" (nullary io//current-time)))))
 
-## [[Box]]
-(def: box//new
-  Unary
-  (|>> (list) ruby.array))
-
-(def: box//read
-  Unary
-  (ruby.nth (ruby.int 0)))
-
-(def: (box//write [valueO boxO])
-  Binary
-  (runtimeT.box//write valueO boxO))
-
-(def: box-procs
-  Bundle
-  (<| (prefix "box")
-      (|> (dict.new text.Hash<Text>)
-          (install "new" (unary box//new))
-          (install "read" (unary box//read))
-          (install "write" (binary box//write)))))
-
 ## [Bundles]
 (def: #export procedures
   Bundle
@@ -390,5 +369,4 @@
           (dict.merge frac-procs)
           (dict.merge text-procs)
           (dict.merge io-procs)
-          (dict.merge box-procs)
           )))
-- 
cgit v1.2.3