| 1 | = Method Invocation = |
| 2 | |
| 3 | TODO |
| 4 | |
| 5 | Class Creation |
| 6 | * Instance creation calls the matching class initializer ( matches on arglist and types) |
| 7 | * !ClassName() - no args |
| 8 | * !ClassName( arg,arg,....) |
| 9 | |
| 10 | Class Methods |
| 11 | * call as instance.methodName(args, arg, arg...) |
| 12 | * Methods without params dont require trailing empty () - instance.methodName |
| 13 | * Methods declared without return type have void returnType, cannot be assigned to anything |
| 14 | |
| 15 | Method references |
| 16 | * ref methodName - Obtain a method reference, |
| 17 | * pass to listen/ignore statement or store in a variable of the appropriate type ( sig - method Signature) |
| 18 | * call/invoke using variable name with () following enclosing arglist |
| 19 | * even if no args requires () |
| 20 | * example: |
| 21 | |
| 22 | Anon !Methods/Closures |
| 23 | * Captures any local variables in calling scope if used in anon method |
| 24 | * 'do' keyword |
| 25 | * anon method/closure code indented on following lines |
| 26 | * do |
| 27 | * anon method code |
| 28 | * do(param, param...) |
| 29 | * anon method code |
| 30 | |
| 31 | Lambda |
| 32 | * one line (one expression) anon method |
| 33 | * do = EXPR |
| 34 | * do(<param, param...) = EXPR |
| 35 | |
| 36 | What else ? |
| 37 | |
| 38 | |
| 39 | |
| 40 | == Notes == |
| 41 | |
| 42 | == See Also == |
| 43 | |
| 44 | |
| 45 | [wiki:LanguageTopics Back to LanguageTopics] |