aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/tool/compiler/phase/generation/python/runtime.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation/python/runtime.lux20
1 files changed, 9 insertions, 11 deletions
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/runtime.lux b/stdlib/source/lux/tool/compiler/phase/generation/python/runtime.lux
index d095e9fe2..c4a1a6da2 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/python/runtime.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/python/runtime.lux
@@ -180,19 +180,17 @@
@io//exit!
@io//current-time!))
-(runtime: (product//left product index)
- (with-vars [index-min-length]
+(runtime: (tuple//left tuple lefts)
+ (with-vars [index-right]
($_ _.then
- (_.set (list index-min-length) (_.+ (_.int +1) index))
- (_.if (_.> index-min-length (_.len/1 product))
+ (_.set (list index-right) (_.- (_.int +1)
+ (_.len/1 tuple)))
+ (_.if (_.> lefts index-right)
## No need for recursion
- (_.return (_.nth index product))
+ (_.return (_.nth lefts tuple))
## Needs recursion
- (_.return (product//left (_.nth (_.- (_.int +1)
- (_.len/1 product))
- product)
- (_.- (_.len/1 product)
- index-min-length)))))))
+ (_.return (tuple//left (_.nth index-right tuple)
+ (_.- index-right lefts)))))))
(runtime: (product//right product index)
(with-vars [index-min-length]
@@ -238,7 +236,7 @@
(def: runtime//adt
(Statement Any)
($_ _.then
- @product//left
+ @tuple//left
@product//right
@sum//get))