axiom-math
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-math] Re: [fricas-devel] Re: [open-axiom-devel] [fricas-devel] Re


From: Bill Page
Subject: [Axiom-math] Re: [fricas-devel] Re: [open-axiom-devel] [fricas-devel] Re: [fricas-devel] Re: [fricas-devel] Re: iterators and cartesian product.
Date: Tue, 23 Oct 2007 21:56:44 -0400

On 10/23/07, Ralf Hemmecke wrote:
>
> On 10/24/2007 03:07 AM, Bill Page wrote:
> > On 10/23/07, Ralf Hemmecke wrote:
> >>>> Seems OK, but, of course the _domain_ 1..9 is then inappropriate in a
> >>>> construction like
> >>>>
> >>>>    for i in 1..9 repeat ...
> >>>>
> >>>> don't you agree?
> >>>>
> >>> No. My proposal also includes the idea that the construct
> >>>
> >>>     for i in X repeat
> >>>
> >>> should expect X to be any domain that supplies a generator (like Aldor).
> >> In Aldor, at the place of X there must be an element of type
> >> "Generator(Something)", not a domain.
> >
> > Can you give an example of an "element of type Generator(Something)"
> > that is not a domain?
>
> g: Generator(Integer) := generate {yield 0}
>
> Take g.
>

Ok, yes I see what you mean. But this requires some new basic
functionality in the language, right? Contrast this with 'Stream' in
Axiom which (so far as I understand) does not require such an
extension of Spad.

> ...
> Hmmm, didn't you like
>
> http://lists.gnu.org/archive/html/axiom-math/2007-10/msg00023.html
>
> main(): () == {
>      import from Z, Product(Z, Z);
>      s1: Segment Z := 1..3;
>      s2: Segment Z := 11..12;
>      for ab in s1 * s2 repeat {
>          (a, b) := ab;
>          stdout << a << ", " << b << newline;
>      }
> }
>

Yes, that is "ok" but ... we already have a domain construction
Product in the Axiom library that takes two *domains* as it's
parameters.

> ???
>
> What you want is available now and no need of 1..9 being a domain.
>

I did not intend to introduce any new constructor for Product.

Regards,
Bill Page.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]