-
Notifications
You must be signed in to change notification settings - Fork 0
Useful shortcuts
Sidharth Kulkarni edited this page Apr 6, 2016
·
1 revision
Here are some useful shortcuts relevant to MOO programming. However, they have some pitfalls that must be kept in mind.
-
(obj:verb-name arg1 arg2 ...)=>(verbcall obj "verb-name" (arg1 arg2 ...)) -
obj.prop-name=>(getprop obj "prop-name")
obj, verb-name, and prop-name in all of these cannot be expressions, they must be simple symbols. For example, the following will NOT work:
(parent obj).name(obj:(cat "verb-" "name"))(obj.prop:verb argument)
The transformations occur during lexical analysis and are meant to be simple convenience macros.