Download CuPit | A Parallel Language for Neural Algorithms: Language
Transcript
58
11 EXPRESSIONS
Expression[77] f
E12:
'(' Expression ')' /
Object /
Denoter /
FunctionCall /
ObjectFunctionCall.
Data Object Access[80]
Denoter[78]
Function Call[79]
g
This macro is dened in denitions 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, and 77.
This macro is invoked in denition 85.
78
Denoter[78] f
Denoter:
IntegerDenoter /
RealDenoter /
StringDenoter.
g
This macro is invoked in denition 77.
11.4 Function call
79
Function Call[79] f
FunctionCall:
FunctionId '(' ArgumentList ')'.
FunctionId:
LowercaseIdent.
ObjectFunctionCall:
Object '.' ObjectFunctionId '(' ArgumentList ')'.
ObjectFunctionId:
LowercaseIdent.
g
This macro is invoked in denition 77.
Function calls look exactly like procedure calls. The dierence is that functions return a value. This value
can usually be used just like any other value of the same type. Function calls that involve parallelism,
however, are allowed only if they do not change the amount of parallelism: Object function calls to
network functions from within network functions or network procedures and object function calls to
node functions from within node functions or node procedures and object function calls to connection
functions from within connection functions or connection procedures work just like other normal function
calls; object function calls to node functions from network functions or network procedures and object
function calls to connection functions from node functions or node procedures are not allowed. Object
function calls to network functions from the central agent are an exception: They return the result from
the rst network replicate. Design rationale: We could allow function calls into a higher level of parallelism
instead of the data element in a reduction statement. I didn't do it in order to keep the semantics and
implementation of the reduction statement simple.
77