The Hyper Programming Language |
home | language reference | compiler | hyper on launchpad |
Hyper supports implicit procedure calls, which means that a procedure can be called without using a procedure call expression. The advantage is that you can create getters for a class that can be used as a field. So users of that class won't have to remember if they need to use a procedure or a field to get the data they need.
If an expression like an identifier (see literals) or a member selection expression (see postfix expressions) refers to a procedure without the usage of an explicit procedure call expression, then an implicit procedure call will be assumed.
An implicit function call is equivalent to an explicit procedure call where no arguments are specified. The same rules apply, so an implicit procedure call can result in a compiler error saying that there is no suitable procedure overload to be called.
procedure printHello() system.out.printLn("Hello!") end procedure thirteen() : byte return 13 end procedure p() printHello # prints "Hello!" var x : int = thirteen() # explicit procedure call x += thirteen # implicit function call; x becomes 26 end