diff options
author | Eduardo Julian | 2018-05-06 23:27:12 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-05-06 23:27:12 -0400 |
commit | fb72b937aba7886ce204379e97aa06c327a4029f (patch) | |
tree | 20bc243f1605c5b6c37b833b8046b82eac805494 /new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux | |
parent | 0b53bcc87ad3563daedaa64306d0bbe6df01ca49 (diff) |
- Implemented Nat functionality in pure Lux.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux index 65e864d91..3457cc49b 100644 --- a/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux @@ -285,45 +285,6 @@ (def: high (-> Expression Expression) (bit//logical-right-shift (python.int 32))) (def: low (-> Expression Expression) (python.bit-and full-32-bits)) -(runtime: (nat//< param subject) - (with-vars [ph sh] - ($_ python.then! - (python.set! (list ph) (..high param)) - (python.set! (list sh) (..high subject)) - (python.return! (python.or (python.< (@@ ph) (@@ sh)) - (python.and (python.= (@@ ph) (@@ sh)) - (python.< (low param) (low subject)))))))) - -(runtime: (nat/// param subject) - (with-vars [quotient remainder] - (python.if! (python.< (python.int 0) param) - (python.if! (nat//< param subject) - (python.return! (python.int 0)) - (python.return! (python.int 1))) - ($_ python.then! - (python.set! (list quotient) (|> subject - (python.bit-shr (python.int 1)) - (python./ param) - (python.bit-shl (python.int 1)))) - (let [remainder (python.- (python.* param (@@ quotient)) - subject)] - (python.if! (python.not (nat//< param remainder)) - (python.return! (python.+ (python.int 1) (@@ quotient))) - (python.return! (@@ quotient)))))))) - -(runtime: (nat//% param subject) - (let [flat (|> subject - (nat/// param) - (python.* param))] - (python.return! (|> subject (python.- flat))))) - -(def: runtime//nat - Runtime - ($_ python.then! - @@nat//< - @@nat/// - @@nat//%)) - (runtime: (deg//* param subject) (with-vars [$sL $sH $pL $pH $bottom $middle $top] ($_ python.then! @@ -561,7 +522,6 @@ runtime//lux runtime//adt runtime//bit - runtime//nat runtime//deg runtime//frac runtime//text |