Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
package metaobjectTest
Metaobject 'shouldCallSuperMethod' is an action function. Its
associated metaobject declares a method 'eval' that may be
called by other metaobjects. It cannot be associated to
an annotation:
// compile-time error
This action function can be called by method 'call:' of
Myan or Tyan (interpreted Cyan) or by the following
WrEnv env = compiler.getEnv();
IActionFunction f = env.searchActionFunction("shouldCallSuperMethod");
'input' is a saci.Tuple6 (saci is a Cyan Compiler package) whose elements
- the compiler passed as parameter to a metaobject method
- the metaobject
- the list of annotation parameters
- a symbol to be used if there is an error
- the current method
- the environment
All of these parameters are automatically passed when using method
'call:' of Myan or Tyan, as in the example of annotation 'onOverride'
object ShouldCallSuperMethod
// the overridden method should call
// this method in its first statement
// shouldCallSuperMethod is an action function
// of package cyan.lang
call: #shouldCallSuperMethod;
func run {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment