aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/scheme/loop.jvm.lux
diff options
context:
space:
mode:
authorEduardo Julian2018-06-17 00:27:21 -0400
committerEduardo Julian2018-06-17 00:27:21 -0400
commitb6ccfc87c52e1a98ead3b04b45bccc119418a4dc (patch)
treedb13d4605a0a3041de6ef2ef5ddc92b766f1a7f3 /new-luxc/source/luxc/lang/translation/scheme/loop.jvm.lux
parentbcd3d9ee8f6797f758a2abea98d5cb6a74cc7df0 (diff)
- Migrated Scheme back-end to stdlib.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/scheme/loop.jvm.lux37
1 files changed, 0 insertions, 37 deletions
diff --git a/new-luxc/source/luxc/lang/translation/scheme/loop.jvm.lux b/new-luxc/source/luxc/lang/translation/scheme/loop.jvm.lux
deleted file mode 100644
index c64973d8f..000000000
--- a/new-luxc/source/luxc/lang/translation/scheme/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)))))