diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-12-30 23:58:47 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-12-30 23:58:47 -0800 |
| commit | 5059c081ac624ede925d5256885509ddd17181c6 (patch) | |
| tree | 0457d135e5193126bf73466bfaae09df94ab8a7d /lib/things.nom | |
| parent | ec69ee6f62016a2edcc13e3183cbe4cadd75717f (diff) | |
Auto-upgraded code.
Diffstat (limited to 'lib/things.nom')
| -rw-r--r-- | lib/things.nom | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/things.nom b/lib/things.nom index e10b9eb..cf5a53f 100644 --- a/lib/things.nom +++ b/lib/things.nom @@ -106,14 +106,14 @@ externally (a class named $classname with $members ((initialize $it)'s meaning)) barf "Cannot set \$key, it's not one of the allowed member fields." set $class's metatable to { - .__tostring = ($class -> $class.__type), .__call = ( + .__tostring = ($class -> $class.__type) + .__call = for ($class with $initial_values): if ($initial_values == (nil)): return $class set $initial_values's metatable to $class if $initial_values.set_up: $initial_values, set up return $initial_values - ) } if ((initialize)'s meaning): @@ -136,8 +136,15 @@ externally (a class named $classname with $members ((initialize $it)'s meaning)) return Lua (" - \$class_id = a_class_named_1_with(\(quote $classname.stub), \($members as lua)\((Lua ", function(\$class_id)\n \$body_lua\nend") if $class_body else "")\ - ..) + \$class_id = a_class_named_1_with(\(quote $classname.stub), \($members as lua)\( + ( + Lua (" + , function(\$class_id) + \$body_lua + end + ") + ) if $class_body else "" + )) a_\$class_id = function(initial_values) return \($classname.stub, as lua id)(initial_values \ ..or {}) end an_\$class_id, a_\($class_id)_with, an_\($class_id)_with = a_\$class_id, a_\$class_id, a_\$class_id |
