> Ah, what's the specification of "return"?
Oh, that was not my point.
However,
(cond => X) is essentially (if cond then X)
(cond => X; Y) is essentially (if cond then X else Y)
In the first case, it is not clear what the type of the return value is
if cond is false.
You need "return" in cases like
foo(...): INT ==
for i in 1..10 repeat
prime?(i) => return i
print i
-1
Without "return" that function would always give -1, because "=>" ends
the block (= body of the loop), but not the whole loop.
Additionally it will print i for the **all** i in 1..10 for which
cond?(i) is false.
%%% (154) -> foo():INT ==(for i in 1..10 repeat (prime? i => i; print
i); -1)
Function declaration foo : () -> Integer has been added to
workspace.
%%% (155) -> foo()
Compiling function foo with type () -> Integer
1
4
6
8
9
10
(155) - 1
Ralf