diff options
Diffstat (limited to 'stdlib/source/lux/compiler/default/phase/translation/scheme/extension/common.jvm.lux')
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/translation/scheme/extension/common.jvm.lux | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/stdlib/source/lux/compiler/default/phase/translation/scheme/extension/common.jvm.lux b/stdlib/source/lux/compiler/default/phase/translation/scheme/extension/common.jvm.lux index a508dfabd..3aa2b453d 100644 --- a/stdlib/source/lux/compiler/default/phase/translation/scheme/extension/common.jvm.lux +++ b/stdlib/source/lux/compiler/default/phase/translation/scheme/extension/common.jvm.lux @@ -269,28 +269,15 @@ (bundle.install "exit" (unary _.exit/1)) (bundle.install "current-time" (nullary (function (_ _) (runtime.io//current-time (_.string synthesis.unit)))))))) -## [[Atoms]] -(def: atom::new +## [[Box]] +(def: box::new Unary (|>> (list) _.vector/*)) -(def: (atom::read atom) +(def: (box::read box) Unary - (_.vector-ref/2 atom (_.int +0))) - -(def: (atom::compare-and-swap [atomO oldO newO]) - Trinary - (runtime.atom//compare-and-swap atomO oldO newO)) + (_.vector-ref/2 box (_.int +0))) -(def: bundle::atom - Bundle - (<| (bundle.prefix "atom") - (|> bundle.empty - (bundle.install "new" (unary atom::new)) - (bundle.install "read" (unary atom::read)) - (bundle.install "compare-and-swap" (trinary atom::compare-and-swap))))) - -## [[Box]] (def: (box::write [valueO boxO]) Binary (runtime.box//write valueO boxO)) @@ -299,8 +286,8 @@ Bundle (<| (bundle.prefix "box") (|> bundle.empty - (bundle.install "new" (unary atom::new)) - (bundle.install "read" (unary atom::read)) + (bundle.install "new" (unary box::new)) + (bundle.install "read" (unary box::read)) (bundle.install "write" (binary box::write))))) ## [[Processes]] @@ -327,7 +314,6 @@ (dict.merge bundle::text) (dict.merge bundle::array) (dict.merge bundle::io) - (dict.merge bundle::atom) (dict.merge bundle::box) (dict.merge bundle::process) ))) |