![]() |
| ||||||||
Navigation |
Synopsis Function call.
Syntax
Name ( Exp1, Exp2, ... )
Types
Description First, the actual parameter expressions
Expi are evaluated resulting in values Vi .
Based on Name and the argument types Ti , the identity of the function to be called is determined.
The values Vi are bound to the formal parameter names of the
declared functions and the function body is executed.
The value returned by the function is used as value of the function call.
A constructor call has identical syntax to that of a function call, see Constructor, See Function for more details about function declarations.
Examples First declare a function
square with argument n that returns n2 :
rascal>int square(int n) { return n * n; }
int (int): int square(int);
Next call square . This results in the following steps:
rascal>square(12);
int: 144
![]() |