|
| |||||||
| Navigation |
Synopsis Retrieve an argument of a node via its index.
Syntax
Exp1 [ Exp2 ]
Types
Description Node subscription uses the integer value of
Exp2 as index in the argument list of the node value of Exp1.
The value of Exp2 should be greater or equal 0 and less than the number of arguments of the node.
If this is not the case, the exception IndexOutOfBounds is thrown.
Examples Introduce a node, assign it to F and retrieve the various arguments:
rascal>F = "f"(1, "abc", false); node: "f"(1,"abc",false) rascal>F[0] value: 1 rascal>F[1] value: "abc" rascal>F[2] value: falseExplore an error case: rascal>F[3];
|stdin:///|(2,1,<1,2>,<1,3>): IndexOutOfBounds(3)
at ___SCREEN_INSTANCE___(|stdin:///|(0,5,<1,0>,<1,5>))
|