------- t.input -----------------------------
x := 1
while x<  4 repeat {output x;  x := x + 1}

g(): Void ==  x := 1
               while x<  4 repeat {output x;  x := x + 1}
---------------------------------------------

Oh, first of all, I am surprised. Since when does it work to have braces in SPAD? I thought that parentheses have to be used.

Waldek, thanks for making that work with braces!!!

Your error lies in the pile syntax.

in

  g(): Void ==  x := 1
                while x<  4 repeat {output x;  x := x + 1}

the first line is the definition of g.
The second line does not belong to g anymore, but is just some indented something.

Correctly you would have to do

g(): Void ==
    x := 1
    while x < 4 repeat {output x;  x := x + 1}

The function body is the block of lines that are indented with the same amount of spaces. In your version "x := 1" is not indented at all. So does *not* belong to a block together with the "while" line.

Hope that helps.

Ralf

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to