aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/data/collection/array.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/data/collection/array.lux26
1 files changed, 22 insertions, 4 deletions
diff --git a/stdlib/source/lux/data/collection/array.lux b/stdlib/source/lux/data/collection/array.lux
index 470640bcf..e407f4877 100644
--- a/stdlib/source/lux/data/collection/array.lux
+++ b/stdlib/source/lux/data/collection/array.lux
@@ -46,7 +46,10 @@
:assume)
@.js
- ("js array new" size)}))
+ ("js array new" size)
+
+ @.python
+ ("python array new" size)}))
(def: #export (size array)
(All [a] (-> (Array a) Nat))
@@ -63,7 +66,10 @@
(:coerce Nat))
@.js
- ("js array length" array)}))
+ ("js array length" array)
+
+ @.python
+ ("python array length" array)}))
(def: #export (read index array)
(All [a]
@@ -87,6 +93,12 @@
(let [output ("js array read" index array)]
(if ("js object undefined?" output)
#.None
+ (#.Some output)))
+
+ @.python
+ (let [output ("python array read" index array)]
+ (if ("python object none?" output)
+ #.None
(#.Some output)))})
#.None))
@@ -103,7 +115,10 @@
:assume)
@.js
- ("js array write" index value array)}))
+ ("js array write" index value array)
+
+ @.python
+ ("python array write" index value array)}))
(def: #export (delete! index array)
(All [a]
@@ -116,7 +131,10 @@
(write! index (:assume (: <elem_type> ("jvm object null"))) array)
@.js
- ("js array delete" index array)})
+ ("js array delete" index array)
+
+ @.python
+ ("python array delete" index array)})
array))
)