> 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

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/2b3146ca-f7b1-4cfc-0b41-cd13f330804d%40hemmecke.org.

Reply via email to