aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/tool/compiler/language/lux/phase/generation/r/loop.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/tool/compiler/language/lux/phase/generation/r/loop.lux')
-rw-r--r--stdlib/source/lux/tool/compiler/language/lux/phase/generation/r/loop.lux64
1 files changed, 0 insertions, 64 deletions
diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/r/loop.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/r/loop.lux
deleted file mode 100644
index c8f8bd1d5..000000000
--- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/r/loop.lux
+++ /dev/null
@@ -1,64 +0,0 @@
-(.module:
- [lux (#- Scope)
- [abstract
- ["." monad (#+ do)]]
- [data
- ["." product]
- ["." text
- ["%" format (#+ format)]]
- [collection
- ["." list ("#\." functor fold)]
- ["." set (#+ Set)]]]
- [math
- [number
- ["n" nat]]]
- [target
- ["_" r]]]
- ["." // #_
- [runtime (#+ Operation Phase Generator)]
- ["#." case]
- ["/#" // #_
- ["#." reference]
- ["/#" // #_
- [synthesis
- ["." case]]
- ["/#" // #_
- ["."synthesis (#+ Scope Synthesis)]
- ["#." generation]
- ["//#" /// #_
- ["#." phase]
- [meta
- [archive (#+ Archive)]]
- [reference
- [variable (#+ Register)]]]]]]])
-
-(def: #export (scope expression archive [offset initsS+ bodyS])
- (Generator (Scope Synthesis))
- (case initsS+
- ## function/false/non-independent loop
- #.Nil
- (expression archive bodyS)
-
- ## true loop
- _
- (do {! ///////phase.monad}
- [$scope (\ ! map _.var (/////generation.gensym "loop_scope"))
- initsO+ (monad.map ! (expression archive) initsS+)
- bodyO (/////generation.with_anchor $scope
- (expression archive bodyS))]
- (wrap (_.block
- ($_ _.then
- (_.set! $scope
- (_.function (|> initsS+
- list.size
- list.indices
- (list\map (|>> (n.+ offset) //case.register)))
- bodyO))
- (_.apply initsO+ $scope)))))))
-
-(def: #export (recur expression archive argsS+)
- (Generator (List Synthesis))
- (do {! ///////phase.monad}
- [$scope /////generation.anchor
- argsO+ (monad.map ! (expression archive) argsS+)]
- (wrap (_.apply argsO+ $scope))))