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: iterators and cartesian product.
Date: Wed, 24 Oct 2007 11:03:21 -0400

On 10/24/07, Gabriel Dos Reis wrote:
> On Wed, 24 Oct 2007, Bill Page wrote:
> | Gaby wrote:
> | > so what wouold
> | >
> | >        for i in PositiveInteger repeat
> | >
> | > does concretely?
> | >
> |
> |   '1..' is another (better?) name for PositiveInteger
>
> No, it is not.  Both behave quite differently in many situations.
>

Actually I agree with you. But what I should have said is that the
domain PositiveInteger can subsume the operations of '1..'.

> | So under my proposal 'for i in PositiveInteger repeat' should function
> | identically to the way
> |
> |    for i in 1.. repeat
>
> so you want to treat a domain as being identical to its ordered list
> of values.  But, a domain is not (just) its set of values.

Of course you are right. I do *not* want to treat a domain as being
identical to it's ordered list of values. A domain is many other
things besides that. However I see no reason why most domains (at
least those in the categories Finite and StepThrough) should not
provide a standard mechanism for doing such iterations.

>  About about
>
>       for i in List(Integer) repeat
>
> or
>
>       for n in BinaryTree(Integer) repeat
>

Yes, List and BinaryTree should be able to provide such iterators.
Sometimes (in particular in these cases) it is difficult to define a
"standard" ordering but the particular default ordering that is chosen
in each case can be easily documented and the alternatives produced by
some auxillary operation or coercion.

> | works now in the interpreter where '1..' denotes an object of
> | 'UniversalSegment PositiveInteger'.
>
> But UniversalSegment is a *particular traversal view* of PositiveInteger.
>

Yes, I agree. Why not make in it the "standard" one for PositiveInteger?

Regards,
Bill Page.




reply via email to

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