aboutsummaryrefslogtreecommitdiff
path: root/lib/object.nom
diff options
context:
space:
mode:
Diffstat (limited to 'lib/object.nom')
-rw-r--r--lib/object.nom22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/object.nom b/lib/object.nom
index c5c0091..5f12170 100644
--- a/lib/object.nom
+++ b/lib/object.nom
@@ -4,18 +4,18 @@
use "core"
compile [@, me] to: Lua value "self"
-compile [set methods %methods] to
- %lua <- (Lua "")
- for %m in %methods
- to %lua write "\nclass.\(%m as lua id) = \(%m as lua id)"
- return %lua
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-parse [method %actions %body] as
- with local %actions
- action %actions %body
- set methods %actions
+compile [method %actions %body] to
+ %lua <- (compile as: action %actions %body)
+ add free vars ((% as lua id) for % in %actions) to %lua
+ declare locals in %lua
+ for % in %actions
+ to %lua write "\nclass.\(% as lua id) = \(% as lua id)"
+ return
+ Lua ".."
+ do -- Method: \(%actions.1.stub)
+ \%lua
+ end
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
parse [as %instance %body] as