Next: Object type determination, Previous: Object creation, Up: Syntax
Unlike in other languages, there is a syntactic difference between dereferencing an object and
calling a method on an object. The dot (.
) operator dereferences a class and
returns the contents:
x = class.property;
The pipe (|
), on the other hand, dereferences the method and then calls it with the arguments
and object given:
x|doWork();
Any arguments passed to the method are within the parenthesis (which are optional if no arguments are being passed). For methods not defined in a class, the parenthesis are required for Kite to determine whether you want the method object or to call the method.