aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data/text/buffer.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/data/text/buffer.lux')
-rw-r--r--stdlib/source/library/lux/data/text/buffer.lux42
1 files changed, 21 insertions, 21 deletions
diff --git a/stdlib/source/library/lux/data/text/buffer.lux b/stdlib/source/library/lux/data/text/buffer.lux
index 2d8708c58..196227220 100644
--- a/stdlib/source/library/lux/data/text/buffer.lux
+++ b/stdlib/source/library/lux/data/text/buffer.lux
@@ -67,37 +67,37 @@
... default
row.empty))))
- (def: .public (append chunk buffer)
+ (def: .public (then chunk buffer)
(-> Text Buffer Buffer)
(with_expansions [<jvm> (let [[capacity transform] (:representation buffer)
- append! (: (-> Text java/lang/StringBuilder java/lang/StringBuilder)
- (function (_ chunk builder)
- (exec
- (java/lang/Appendable::append (:as java/lang/CharSequence chunk)
- builder)
- builder)))]
+ then! (: (-> Text java/lang/StringBuilder java/lang/StringBuilder)
+ (function (_ chunk builder)
+ (exec
+ (java/lang/Appendable::append (:as java/lang/CharSequence chunk)
+ builder)
+ builder)))]
(:abstraction [(n.+ (//.size chunk) capacity)
- (|>> transform (append! chunk))]))]
+ (|>> transform (then! chunk))]))]
(for {@.old <jvm>
@.jvm <jvm>
@.js (let [[capacity transform] (:representation buffer)
- append! (: (-> (JS_Array Text) (JS_Array Text))
- (function (_ array)
- (exec
- (JS_Array::push [chunk] array)
- array)))]
+ then! (: (-> (JS_Array Text) (JS_Array Text))
+ (function (_ array)
+ (exec
+ (JS_Array::push [chunk] array)
+ array)))]
(:abstraction [(n.+ (//.size chunk) capacity)
- (|>> transform append!)]))
+ (|>> transform then!)]))
@.lua (let [[capacity transform] (:representation buffer)
- append! (: (-> (array.Array Text) (array.Array Text))
- (function (_ array)
- (exec
- (table/insert [array chunk])
- array)))]
+ then! (: (-> (array.Array Text) (array.Array Text))
+ (function (_ array)
+ (exec
+ (table/insert [array chunk])
+ array)))]
(:abstraction [(n.+ (//.size chunk) capacity)
- (|>> transform append!)]))}
+ (|>> transform then!)]))}
... default
- (|> buffer :representation (row.add chunk) :abstraction))))
+ (|> buffer :representation (row.suffix chunk) :abstraction))))
(def: .public size
(-> Buffer Nat)