> reading your mail, I understand that => is an other name for the > << if then elif elif ... >> structure. > The 30-year books (p.60-61) explains that => leaves a block. > The command break quit the inner loop (for or while)
Same in Aldor. => does not abort the for loop. for i in 1..3 repeat (i>1 => (print i; u:=i)) will print 2 and 3 and set u=3. --AXIOM (4) -> for i in 1..3 repeat (i>1 => (print i; u:=i)) 2-> 3 --END AXIOM >> unklimint(f, x, lu) == >> for u in lu | u ^= 0 repeat >> zero? differentiate(c := f * u / differentiate(u, x), x) => [0,[[c,u]]] >> "failed" > > So I bet for => return [0, [[c,u]]. Supported. >> In other places, they just put anything after =>, for example, in >> gdpoly.spad: >> >> coerce(p: %) : OutputForm == >> zero?(p) => (0$R) :: OutputForm >> l,lt : List OutputForm >> lt := nil >> vl1 := [v::OutputForm for v in vl] >> for t in reverse p repeat >> l := nil >> for i in 1..#vl1 repeat >> t.k.i = 0 => l >> -- ^^ >> -- || this has no effect. Looks like that should be something like for i in 1..#vl1 repeat t.k.i = 0 => iterate; (At least that is what I would write in Aldor instead of putting a dummy value.) > What is the reponse ? > return l and end the function. > break and finish the loop, go to 1=#lt > iterate : nothink to do with i, treat i+1. > >> t.k.i = 1 => l := cons(vl1.i,l) >> l := cons(vl1.i ** t.k.i ::OutputForm,l) >> l := reverse l >> if (t.c ^= 1) or (null l) then l := cons(t.c :: OutputForm,l) >> 1 = #l => lt := cons(first l,lt) >> lt := cons(reduce("*",l),lt) >> 1 = #lt => first lt >> reduce("+",lt) >> >> I propose to replace '=> l' here with '=> "leave"'. > >> In fact, I propose to replace also "iterate" and "next" with >> "leave", hoping that this would be less misleading. > So it seems that iterate = next. The axiom keywork is iterate, > the word << next >> is redundant. Bear in mind that "iterate" and "break" have different semantics. > Am I right when I understand that break keyword = leave ? "leave" has been renamed to "break" in Aldor. I would be happy if SPAD could adopt this change in the future in order to make SPAD and Aldor more compatible. Ralf ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ open-axiom-devel mailing list open-axiom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open-axiom-devel