Version 1 (modified by hopscc, 13 years ago) |
---|
Method Invocation
TODO
Class Creation
- Instance creation calls the matching class initializer ( matches on arglist and types)
- ClassName() - no args
- ClassName( arg,arg,....)
Class Methods
- call as instance.methodName(args, arg, arg...)
- Methods without params dont require trailing empty () - instance.methodName
- Methods declared without return type have void returnType, cannot be assigned to anything
Method references
- ref methodName - Obtain a method reference,
- pass to listen/ignore statement or store in a variable of the appropriate type ( sig - method Signature)
- call/invoke using variable name with () following enclosing arglist
- even if no args requires ()
- example:
Anon Methods/Closures
- Captures any local variables in calling scope if used in anon method
- 'do' keyword
- anon method/closure code indented on following lines
- do
- anon method code
- do(param, param...)
- anon method code
Lambda
- one line (one expression) anon method
- do = EXPR
- do(<param, param...) = EXPR
What else ?