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/lua/runtime.jvm.lux | |
parent | 0b53bcc87ad3563daedaa64306d0bbe6df01ca49 (diff) |
- Implemented Nat functionality in pure Lux.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux index 64253b1c3..cd5d0c090 100644 --- a/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux @@ -197,36 +197,6 @@ (format @@bit//count @@bit//logical-right-shift)) -(runtime: (nat//< param subject) - (lua.return! (lua.apply "math.ult" (list subject param)))) - -(runtime: (nat/// param subject) - (lua.if! (lua.< (lua.int 0) param) - (lua.if! (nat//< param subject) - (lua.return! (lua.int 0)) - (lua.return! (lua.int 1))) - (lua.block! (list (lua.local! "quotient" (#.Some (|> subject - (lua.bit-shr (lua.int 1)) - (lua.// param) - (lua.bit-shl (lua.int 1))))) - (lua.local! "remainder" (#.Some (lua.- (lua.* param "quotient") - subject))) - (lua.if! (lua.not (nat//< param "remainder")) - (lua.return! (lua.+ (lua.int 1) "quotient")) - (lua.return! "quotient")))))) - -(runtime: (nat//% param subject) - (let [flat (|> subject - (nat/// param) - (lua.* param))] - (lua.return! (lua.- flat subject)))) - -(def: runtime//nat - Runtime - (format @@nat//< - @@nat/// - @@nat//%)) - (runtime: deg//low-mask (|> (lua.int 1) (lua.bit-shl (lua.int 32)) @@ -477,7 +447,6 @@ (format runtime//lux runtime//adt runtime//bit - runtime//nat runtime//deg runtime//text runtime//array |