On Sat, Oct 07, 2023 at 06:10:40PM +0200, Ralf Hemmecke wrote:
> (394) -> for i in 1..10 repeat (print i; print(i^2);)
> Line 1: for i in 1..10 repeat (print i; print(i^2);)
> ...........................................A
> Error A: syntax error at top level
> Error A: Improper syntax.
> 2 error(s) parsing
>
> Maybe it is more obvious in the above form that an empty statement is there.
> Originally it was something like this:
>
> for i in 1..10 repeat
> print i;
> print(i^2);
>
> in a .input file.
Actually, this enough
(print 1; print(2);)
> This
>
> for i in 1..10 repeat ()
>
> works just fine,
Intepreter has special case to handle empty tuple '()'.
> so why doesn't the one at the beginning?
> I think, it should be allowed to have one trailing semicolon. No?
Should, yes. AFAICS this works is Spad. In interpreter this
may be problematic.
--
Waldek Hebisch