From eea58ee669f69fddf2cef9e1675c41959e2e0a55 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 31 Jul 2018 18:36:18 -0400 Subject: Now implementing atom functionality in stdlib instead of the compiler. --- .../lang/translation/r/procedure/common.jvm.lux | 22 ---------------------- .../source/luxc/lang/translation/r/runtime.jvm.lux | 16 ---------------- 2 files changed, 38 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/r') 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 c17eb6738..d8f4f4662 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 @@ -350,27 +350,6 @@ (install "current-time" (nullary (function (_ _) (runtimeT.io//current-time! runtimeT.unit))))))) -## [[Atoms]] -(def: atom//new - Unary - (|>> [runtimeT.atom//field] (list) r.named-list)) - -(def: atom//read - Unary - (r.nth (r.string runtimeT.atom//field))) - -(def: (atom//compare-and-swap [atomO oldO newO]) - Trinary - (runtimeT.atom//compare-and-swap atomO oldO newO)) - -(def: atom-procs - Bundle - (<| (prefix "atom") - (|> (dict.new text.Hash) - (install "new" (unary atom//new)) - (install "read" (unary atom//read)) - (install "compare-and-swap" (trinary atom//compare-and-swap))))) - ## [[Box]] (def: box//new Unary @@ -420,7 +399,6 @@ (dict.merge text-procs) (dict.merge array-procs) (dict.merge io-procs) - (dict.merge atom-procs) (dict.merge box-procs) (dict.merge process-procs) ))) diff --git a/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux index fd4adfb1a..ee46836cb 100644 --- a/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux @@ -764,21 +764,6 @@ @@array//get @@array//put)) -(def: #export atom//field Text "lux_atom") - -(runtime: (atom//compare-and-swap atom old new) - (let [atom//field (r.string atom//field)] - (r.if (|> (@@ atom) (r.nth atom//field) (r.= (@@ old))) - ($_ r.then - (r.set-nth! atom//field (@@ new) atom) - (r.bool #1)) - (r.bool #0)))) - -(def: runtime//atom - Runtime - ($_ r.then - @@atom//compare-and-swap)) - (runtime: (box//write value box) ($_ r.then (r.set-nth! (r.int 1) (@@ value) box) @@ -859,7 +844,6 @@ runtime//frac runtime//text runtime//array - runtime//atom runtime//box runtime//io runtime//process -- cgit v1.2.3