Syntax![]() UseThe instruction evaluates the right block for each value resulting from the left expression, and builds a list corresponding to the results of all iterations. The syntax The loop syntax Example1// Like OCaml's List.map or JavaScript Array.map TMP allReqPriorities := getAllRequirements.(Title + "|" + revision + "|" + Priority); Example2// Like imperative loop
TMP fibonacci := 0 $+ 1; // predefines fib(0) and fib(1)
$INTERVAL(2 $+ 10).{ // computes from fib(2) to fib(10)
fibonacci += $AT(fibonacci, -1) + $AT(fibonacci, -2)
};
Example3// Like List.map but using instruction block instead of simple expression
OPENBUFF;
getAllRequirements.{
PUTF("* $1 $2"n", Title, revision);
PUTN("Description:");
PUTN(`Content Text`);
// in this case, the result of the stream operation is irrelevant
};
TMP allReqsAsText := CLOSE;
| |||||||||