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: Wed, 24 Oct 2007 10:07:20 -0400

On 10/24/07, Gabriel Dos Reis wrote:
> ...
> Stream is an *example* of a generator like domain.  I would not want
> to turn my BinaryTree into a Stream before iterating over it.
>

It seems very natural to me to write:

    t:BinaryTree Integer
    t:= ...
    for i in t repeat ...

but perhaps the meaning is not so clear. Over exact what objects are
we iterating? There are several operations in BinaryTree(S) that
produce 'List S' or 'List %' output, for example:

leaves : % -> List S
nodes : % -> List %
children : % -> List %
members : % -> List S
parts : % -> List S

In any case right now in Axiom you are forced to turn your binary tree
into a List which is surely worse then returning a Stream, no?

Unfortunately there is a bug in 'members':

(1) -> t:BinaryTree(Integer)
                                                                   Type: Void
(2) -> t:=binaryTree(10)

   (2)  10
                                                     Type: BinaryTree Integer
(3) -> t:=binaryTree(t,3,binaryTree 20)

   (3)  [10,3,20]
                                                     Type: BinaryTree Integer
(4) -> members t
Function:  parts : % -> List Integer is missing from domain: BinaryTree Integer
   Internal Error
   The function parts with signature (List (Integer))$ is missing from
      domain BinaryTree(Integer)

--------

Regards,
Bill Page.




reply via email to

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