[Wrapl-discussion] K(expr1, ..., exprN)
Brought to you by:
rajamukherji
|
From: Roman M. <rom...@gm...> - 2010-05-24 08:44:52
|
Hello.
I am going through the Wrapl's tutorial and am trying to employ this
function call: K(expr1, ..., exprN).
I understand how it is intended to work and if K is an explicit integer, it
works as expected, but if K is calculated, only expr1 is selected, no more.
For example:
MOD bottles;
IMP IO.Terminal USE Out;
VAR s <- "s"; DEF ob <- "of beer"; DEF otw <- "on the wall"; VAR i;
EVERY i <- 9:to(0,-1) DO (
((2 > i) + 1)(s <- "s", s <- "");
Out:write('{i} bottle{s} {ob} {otw}.\n');
);
END bottles.
outputs:
...
2 bottles of beer on the wall.
1 bottle of beer on the wall.
0 bottle of beer on the wall.
I want it to be:
...
2 bottles of beer on the wall.
1 bottle of beer on the wall.
0 bottles of beer on the wall.
I am on Windows XP, Wrapl [1.1.5:864].
|