aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/r/loop.jvm.lux
diff options
context:
space:
mode:
authorEduardo Julian2020-05-30 15:19:28 -0400
committerEduardo Julian2020-05-30 15:19:28 -0400
commitb4d0eba7485caf0c6cf58de1193a9114fa273d8b (patch)
treef6f7fa2967bb5923347db1ed1d4c9b08e56bf8c6 /new-luxc/source/luxc/lang/translation/r/loop.jvm.lux
parent6eaa3b57f3f1ea2ce13b942bdb4ef502fc1729bc (diff)
Split new-luxc into lux-jvm and lux-r.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/r/loop.jvm.lux')
-rw-r--r--new-luxc/source/luxc/lang/translation/r/loop.jvm.lux37
1 files changed, 0 insertions, 37 deletions
diff --git a/new-luxc/source/luxc/lang/translation/r/loop.jvm.lux b/new-luxc/source/luxc/lang/translation/r/loop.jvm.lux
deleted file mode 100644
index f1197e5ce..000000000
--- a/new-luxc/source/luxc/lang/translation/r/loop.jvm.lux
+++ /dev/null
@@ -1,37 +0,0 @@
-(.module:
- lux
- (lux (control [monad #+ do])
- (data [text]
- text/format
- (coll [list "list/" Functor<List>]))
- [macro])
- (luxc [lang]
- (lang ["ls" synthesis]
- (host [r #+ Expression @@])))
- [//]
- (// [".T" reference]))
-
-(def: #export (translate-loop translate offset initsS+ bodyS)
- (-> (-> ls.Synthesis (Meta Expression)) Nat (List ls.Synthesis) ls.Synthesis
- (Meta Expression))
- (do {@ macro.Monad<Meta>}
- [loop-name (|> (macro.gensym "loop")
- (:: @ map (|>> %code lang.normalize-name)))
- initsO+ (monad.map @ translate initsS+)
- bodyO (//.with-anchor [loop-name offset]
- (translate bodyS))
- #let [$loop-name (r.var loop-name)
- @loop-name (@@ $loop-name)]
- _ (//.save (r.set! $loop-name
- (r.function (|> (list.n/range +0 (dec (list.size initsS+)))
- (list/map (|>> (n/+ offset) referenceT.variable)))
- bodyO)))]
- (wrap (r.apply initsO+ @loop-name))))
-
-(def: #export (translate-recur translate argsS+)
- (-> (-> ls.Synthesis (Meta Expression)) (List ls.Synthesis)
- (Meta Expression))
- (do {@ macro.Monad<Meta>}
- [[loop-name offset] //.anchor
- argsO+ (monad.map @ translate argsS+)]
- (wrap (r.apply argsO+ (r.global loop-name)))))