diff options
Diffstat (limited to 'stdlib/source/lux/target/jvm/bytecode/environment/limit.lux')
-rw-r--r-- | stdlib/source/lux/target/jvm/bytecode/environment/limit.lux | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/stdlib/source/lux/target/jvm/bytecode/environment/limit.lux b/stdlib/source/lux/target/jvm/bytecode/environment/limit.lux index 2e2312fb5..1bbb40e15 100644 --- a/stdlib/source/lux/target/jvm/bytecode/environment/limit.lux +++ b/stdlib/source/lux/target/jvm/bytecode/environment/limit.lux @@ -1,7 +1,10 @@ (.module: - [lux #* + [lux (#- Type static) [abstract + [monad (#+ do)] ["." equivalence (#+ Equivalence)]] + [control + ["." try (#+ Try)]] [data [number ["n" nat]] @@ -9,16 +12,26 @@ ["#" binary (#+ Writer) ("#@." monoid)]]]] ["." / #_ ["#." stack (#+ Stack)] - ["#." registry (#+ Registry)]]) + ["#." registry (#+ Registry)] + [//// + [type (#+ Type) + [category (#+ Method)]]]]) (type: #export Limit {#stack Stack #registry Registry}) -(def: #export start - Limit - {#stack /stack.empty - #registry /registry.empty}) +(template [<name> <registry>] + [(def: #export (<name> type) + (-> (Type Method) (Try Limit)) + (do try.monad + [registry (<registry> type)] + (wrap {#stack /stack.empty + #registry registry})))] + + [static /registry.static] + [virtual /registry.virtual] + ) (def: #export length ($_ n.+ |