aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/data/collection/bits.lux7
-rw-r--r--stdlib/source/library/lux/data/collection/list.lux8
-rw-r--r--stdlib/source/library/lux/data/product.lux5
-rw-r--r--stdlib/source/library/lux/data/sum.lux4
-rw-r--r--stdlib/source/library/lux/data/text.lux44
-rw-r--r--stdlib/source/library/lux/data/text/escape.lux30
6 files changed, 48 insertions, 50 deletions
diff --git a/stdlib/source/library/lux/data/collection/bits.lux b/stdlib/source/library/lux/data/collection/bits.lux
index 1e84ee9c4..e54f99e21 100644
--- a/stdlib/source/library/lux/data/collection/bits.lux
+++ b/stdlib/source/library/lux/data/collection/bits.lux
@@ -102,7 +102,7 @@
(if (n.< chunks idx)
(.or (|> (..chunk idx sample)
(i64.and (..chunk idx reference))
- ("lux i64 =" empty_chunk)
+ (.i64_=# empty_chunk)
.not)
(again (++ idx)))
false))))
@@ -170,8 +170,7 @@
(array.size sample))]
(loop (again [idx 0])
(if (n.< size idx)
- (.and ("lux i64 ="
- (..chunk idx reference)
- (..chunk idx sample))
+ (.and (.i64_=# (..chunk idx reference)
+ (..chunk idx sample))
(again (++ idx)))
true))))))
diff --git a/stdlib/source/library/lux/data/collection/list.lux b/stdlib/source/library/lux/data/collection/list.lux
index f6850e380..c0b4c4e87 100644
--- a/stdlib/source/library/lux/data/collection/list.lux
+++ b/stdlib/source/library/lux/data/collection/list.lux
@@ -80,7 +80,7 @@
(def wrong_syntax_error
(template (_ <it>)
- [((`` ("lux in-module" (,, (static .prelude)) .wrong_syntax_error))
+ [((`` (.in_module# (,, (static .prelude)) .wrong_syntax_error))
(symbol <it>))]))
(def .public partial
@@ -468,7 +468,7 @@
8 "8"
9 "9"
_ (undefined))
- output' ("lux text concat" digit output)
+ output' (.text_composite# digit output)
input' (n./ 10 input)]
(.when input'
0 output'
@@ -491,7 +491,7 @@
(each (function (_ idx)
(let [base (nat#encoded idx)]
[(symbol$ base)
- (symbol$ ("lux text concat" base "'"))]))))
+ (symbol$ (.text_composite# base "'"))]))))
pattern (` [(,* (each (function (_ [v vs]) (` {.#Item (, v) (, vs)}))
vars+lists))])
g!step (symbol$ "0step0")
@@ -535,7 +535,7 @@
(each (function (_ idx)
(let [base (nat#encoded idx)]
[(symbol$ base)
- (symbol$ ("lux text concat" base "'"))]))))
+ (symbol$ (.text_composite# base "'"))]))))
pattern (` [(,* (each (function (_ [v vs]) (` {.#Item (, v) (, vs)}))
vars+lists))])
g!step (symbol$ "0step0")
diff --git a/stdlib/source/library/lux/data/product.lux b/stdlib/source/library/lux/data/product.lux
index 6c1143dc2..50ab886e2 100644
--- a/stdlib/source/library/lux/data/product.lux
+++ b/stdlib/source/library/lux/data/product.lux
@@ -63,6 +63,5 @@
(..equivalence (at left equivalence)
(at right equivalence)))
(def (hash [leftV rightV])
- ("lux i64 +"
- (at left hash leftV)
- (at right hash rightV)))))
+ (.i64_+# (at left hash leftV)
+ (at right hash rightV)))))
diff --git a/stdlib/source/library/lux/data/sum.lux b/stdlib/source/library/lux/data/sum.lux
index 72d5d52df..9dc3e6f7b 100644
--- a/stdlib/source/library/lux/data/sum.lux
+++ b/stdlib/source/library/lux/data/sum.lux
@@ -88,7 +88,7 @@
(def (hash value)
(.nat (when value
{.#Left value}
- ("lux i64 *" +2 (.int (at left hash value)))
+ (.int_*# +2 (.int (at left hash value)))
{.#Right value}
- ("lux i64 *" +3 (.int (at right hash value))))))))
+ (.int_*# +3 (.int (at right hash value))))))))
diff --git a/stdlib/source/library/lux/data/text.lux b/stdlib/source/library/lux/data/text.lux
index 8502d1d76..e1ac2856b 100644
--- a/stdlib/source/library/lux/data/text.lux
+++ b/stdlib/source/library/lux/data/text.lux
@@ -27,7 +27,7 @@
... (The JVM specifies chars as 16-bit unsigned integers)
(def .public of_char
(-> Char Text)
- (|>> .int "lux i64 char"))
+ (|>> .int .int_char#))
(with_template [<code> <short> <long>]
[(def .public <long> (..of_char <code>))
@@ -49,17 +49,17 @@
(def .public size
(-> Text Nat)
- (|>> "lux text size"))
+ (|>> .text_size#))
(def .public (char index input)
(-> Nat Text (Maybe Char))
- (if (n.< ("lux text size" input) index)
- {.#Some ("lux text char" index input)}
+ (if (n.< (.text_size# input) index)
+ {.#Some (.text_char# index input)}
{.#None}))
(def .public (index_since offset pattern input)
(-> Nat Text Text (Maybe Nat))
- ("lux text index" offset pattern input))
+ (.text_index# offset pattern input))
(def .public (index pattern input)
(-> Text Text (Maybe Nat))
@@ -70,7 +70,7 @@
(loop (again [offset 0
output (is (Maybe Nat)
{.#None})])
- (let [output' ("lux text index" offset part text)]
+ (let [output' (.text_index# offset part text)]
(when output'
{.#None}
output
@@ -104,7 +104,7 @@
(def .public (contains? sub text)
(-> Text Text Bit)
- (when ("lux text index" 0 sub text)
+ (when (.text_index# 0 sub text)
{.#Some _}
true
@@ -113,15 +113,15 @@
(def .public (prefix param subject)
(-> Text Text Text)
- ("lux text concat" param subject))
+ (.text_composite# param subject))
(def .public (suffix param subject)
(-> Text Text Text)
- ("lux text concat" subject param))
+ (.text_composite# subject param))
(def .public (enclosed [left right] content)
(-> [Text Text] Text Text)
- (all "lux text concat" left content right))
+ (all .text_composite# left content right))
(def .public (enclosed' boundary content)
(-> Text Text Text)
@@ -133,16 +133,16 @@
(def .public (clip offset size input)
(-> Nat Nat Text (Maybe Text))
- (if (|> size (n.+ offset) (n.> ("lux text size" input)))
+ (if (|> size (n.+ offset) (n.> (.text_size# input)))
{.#None}
- {.#Some ("lux text clip" offset size input)}))
+ {.#Some (.text_clip# offset size input)}))
(def .public (clip_since offset input)
(-> Nat Text (Maybe Text))
- (let [size ("lux text size" input)]
+ (let [size (.text_size# input)]
(if (n.> size offset)
{.#None}
- {.#Some ("lux text clip" offset (n.- offset size) input)})))
+ {.#Some (.text_clip# offset (n.- offset size) input)})))
(def .public (split_at at x)
(-> Nat Text (Maybe [Text Text]))
@@ -181,7 +181,7 @@
(<| (maybe.else template)
(do maybe.monad
[[pre post] (..split_by pattern template)]
- (in (all "lux text concat" pre replacement post)))))
+ (in (all .text_composite# pre replacement post)))))
(for @.js (these (def defined?
(macro (_ tokens lux)
@@ -217,10 +217,10 @@
right template])
(when (..split_by pattern right)
{.#Some [pre post]}
- (again (all "lux text concat" left pre replacement) post)
+ (again (all .text_composite# left pre replacement) post)
{.#None}
- ("lux text concat" left right)))]
+ (.text_composite# left right)))]
(for @.old
(as Text
("jvm invokevirtual:java.lang.String:replace:java.lang.CharSequence,java.lang.CharSequence"
@@ -261,7 +261,7 @@
(Equivalence Text)
(implementation
(def (= reference sample)
- ("lux text =" reference sample))))
+ (.text_=# reference sample))))
(def .public order
(Order Text)
@@ -269,7 +269,7 @@
(def equivalence ..equivalence)
(def (< reference sample)
- ("lux text <" reference sample))))
+ (.text_<# reference sample))))
(def .public monoid
(Monoid Text)
@@ -277,7 +277,7 @@
(def identity "")
(def (composite left right)
- ("lux text concat" left right))))
+ (.text_composite# left right))))
(def .public hash
(Hash Text)
@@ -301,7 +301,7 @@
(is (Primitive "java.lang.Long"))
(as Nat))
... Platform-independent default.
- (let [length ("lux text size" input)]
+ (let [length (.text_size# input)]
(loop (again [index 0
hash 0])
(if (n.< length index)
@@ -309,7 +309,7 @@
(|> hash
(i64.left_shifted 5)
(n.- hash)
- (n.+ ("lux text char" index input))))
+ (n.+ (.text_char# index input))))
hash)))))))
(def .public together
diff --git a/stdlib/source/library/lux/data/text/escape.lux b/stdlib/source/library/lux/data/text/escape.lux
index b09ae72c7..46e2ca8e2 100644
--- a/stdlib/source/library/lux/data/text/escape.lux
+++ b/stdlib/source/library/lux/data/text/escape.lux
@@ -88,16 +88,16 @@
(let [post_offset (++ pre_offset)
post_limit (n.- post_offset pre_limit)]
[(format previous
- ("lux text clip" 0 pre_offset current)
+ (.text_clip# 0 pre_offset current)
replacement)
- ("lux text clip" post_offset post_limit current)
+ (.text_clip# post_offset post_limit current)
post_limit]))
(def (unicode_escaped char pre_offset pre_limit previous current)
(-> Char Nat Nat Text Text [Text Text Nat])
(let [code (at n.hex encoded char)
replacement (format ..sigil "u"
- (when ("lux text size" code)
+ (when (.text_size# code)
1 (format "000" code)
2 (format "00" code)
3 (format "0" code)
@@ -105,9 +105,9 @@
post_offset (++ pre_offset)
post_limit (n.- post_offset pre_limit)]
[(format previous
- ("lux text clip" 0 pre_offset current)
+ (.text_clip# 0 pre_offset current)
replacement)
- ("lux text clip" post_offset post_limit current)
+ (.text_clip# post_offset post_limit current)
post_limit]))
(def .public (escaped text)
@@ -115,9 +115,9 @@
(loop (again [offset 0
previous ""
current text
- limit ("lux text size" text)])
+ limit (.text_size# text)])
(if (n.< limit offset)
- (when ("lux text char" offset current)
+ (when (.text_char# offset current)
(^.with_template [<char> <replacement>]
[<char>
(let [[previous' current' limit'] (ascii_escaped <replacement> offset limit previous current)]
@@ -173,22 +173,22 @@
(-> Text Nat Text Text Nat [Text Text Nat])
(let [limit' (|> limit (n.- offset) (n.- ..ascii_escape_offset))]
[(format previous
- ("lux text clip" 0 offset current)
+ (.text_clip# 0 offset current)
replacement)
- ("lux text clip" (n.+ ..ascii_escape_offset offset) limit' current)
+ (.text_clip# (n.+ ..ascii_escape_offset offset) limit' current)
limit']))
(def (unicode_un_escaped offset previous current limit)
(-> Nat Text Text Nat (Try [Text Text Nat]))
(when (|> current
- ("lux text clip" (n.+ ..ascii_escape_offset offset) ..code_size)
+ (.text_clip# (n.+ ..ascii_escape_offset offset) ..code_size)
(at n.hex decoded))
{try.#Success char}
(let [limit' (|> limit (n.- offset) (n.- ..unicode_escape_offset))]
{try.#Success [(format previous
- ("lux text clip" 0 offset current)
+ (.text_clip# 0 offset current)
(//.of_char char))
- ("lux text clip" (n.+ ..unicode_escape_offset offset) limit' current)
+ (.text_clip# (n.+ ..unicode_escape_offset offset) limit' current)
limit']})
{try.#Failure error}
@@ -199,13 +199,13 @@
(loop (again [offset 0
previous ""
current text
- limit ("lux text size" text)])
+ limit (.text_size# text)])
(if (n.< limit offset)
- (when ("lux text char" offset current)
+ (when (.text_char# offset current)
..sigil_char
(let [@sigil (++ offset)]
(if (n.< limit @sigil)
- (when ("lux text char" @sigil current)
+ (when (.text_char# @sigil current)
(^.with_template [<sigil> <un_escaped>]
[<sigil>
(let [[previous' current' limit'] (..ascii_un_escaped <un_escaped> offset previous current limit)]