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/ruby/runtime.jvm.lux | |
parent | 0b53bcc87ad3563daedaa64306d0bbe6df01ca49 (diff) |
- Implemented Nat functionality in pure Lux.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux index c3f2981e1..7f66b0cd5 100644 --- a/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux @@ -181,40 +181,6 @@ (def: high (-> Expression Expression) (bit//logical-right-shift (ruby.int 32))) (def: low (-> Expression Expression) (ruby.bit-and "0xFFFFFFFF")) -(runtime: (nat//< param subject) - (ruby.block! (list (ruby.set! (list "ph") (high param)) - (ruby.set! (list "sh") (high subject)) - (ruby.return! (ruby.or (ruby.< "ph" "sh") - (ruby.and (ruby.= "ph" "sh") - (ruby.< (low param) (low subject)))))))) - -(runtime: (nat/// param subject) - (ruby.if! (ruby.< (ruby.int 0) param) - (ruby.if! (nat//< param subject) - (ruby.return! (ruby.int 0)) - (ruby.return! (ruby.int 1))) - (ruby.block! (list (ruby.set! (list "quotient") (|> subject - (ruby.bit-shr (ruby.int 1)) - (ruby./ param) - (ruby.bit-shl (ruby.int 1)))) - (ruby.set! (list "remainder") (ruby.- (ruby.* param "quotient") - subject)) - (ruby.if! (ruby.not (nat//< param "remainder")) - (ruby.return! (ruby.+ (ruby.int 1) "quotient")) - (ruby.return! "quotient")))))) - -(runtime: (nat//% param subject) - (let [flat (|> subject - (nat/// param) - (ruby.* param))] - (ruby.return! (ruby.- flat subject)))) - -(def: runtime//nat - Runtime - (format @@nat//< - @@nat/// - @@nat//%)) - (runtime: (deg//* param subject) (ruby.block! (list (ruby.set! (list "sL") (low subject)) (ruby.set! (list "sH") (high subject)) @@ -366,7 +332,6 @@ (format runtime//lux "\n" runtime//adt "\n" runtime//bit "\n" - runtime//nat "\n" runtime//deg "\n" runtime//text "\n" runtime//array "\n" |