diff options
author | Eduardo Julian | 2019-04-07 00:50:04 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-04-07 00:50:04 -0400 |
commit | a61c3f2e7bc29c3224264317b14254fe93d503fe (patch) | |
tree | 0560c531001a9442e6861a8ff43289ae621beec3 /stdlib/source/lux/tool/compiler/phase/generation/python/runtime.lux | |
parent | 2a05d8f3711d2e1b6fcccd9a2869478197386a7f (diff) |
- Upgrade the tuple left-access mechanism to the new style.
- Updated JS compiler.
- Updated Python compiler.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/tool/compiler/phase/generation/python/runtime.lux | 20 |
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)) |