Hi Francois,

But is it possible to have an intrinsic loop than an integer loop ?

Dom := OVAR [aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll]
[i for i in dd..ee]

What a question...

Your problem is only because you are struggeling with Axiom.
In Aldor there is only *one* "for" construction and that looks like

  for x in g

where g is of type Generator(Something).
Don't be misled if you see something like

  for x in 1..10

in Aldor. If the object after "in" is not a Generator(?) then the compiler throws in the function "generator". So the above is actually the same as

  for x in generator(1..10)

Voila, again a Generator(Integer). The question now is whether there is a function

  generator: Segment(Integer) -> Generator(Integer)

Of course there is. (OK, in LibAldor, it is actually IntegerSegment.)

So what you see here is that you would have to implement something of that provides a function

  ..

Right. "Two dots" is a library *function* and not a built-in thing.
This now equally applies to SPAD and the Axiom library. You find the definition of ".." in seg.spad.pamphlet.

Well, maybe that doesn't help you too much.

Ralf



_______________________________________________
Axiom-math mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/axiom-math

Reply via email to