> I saw your issue on token iterate (available in interpreter to quit the
> current iteration and continue with others) which seems missing in
> compiler (spad files) [1].
>
> Do not ask me why, but spad files in algebra use "iterate" (verbatim, ie
> a string) in the same way one would use iterate, see e.g. [2].
>
> Actually I see "iterate" used with this semantics also in interpreter's
> input files [3] and boot files [4].
In
foo(): Integer ==
z: Integer := 0
for i in 1..9 repeat
odd? i => iterate
z := z+i
z
it would not be a problem to replace iterate by the string "iterate",
because the loop body has the form
(bool => val; otherval)
and the => operator terminates the block exactly at that position.
You would see a change if the body where
if odd? i then "iterate"
z := z + i
So the iterate keyword is not strictly necessary when used with any
value after =>.
However, The FriCAS book explicitly tells about an iterate keyword. In
this sense, the issue I opened is definitely a bug. And, honestly, I do
not like to see a string in a place where there shouldn't be one. All
such strings look like workarounds.
BTW, also in places like
"+": (%,%)->%
there shouldn't actually be quotes. It's a weakness of the SPAD compiler.
Ralf