Re: [fricas-devel] Re: A simple question

root <[email protected]>
Newsgroups gmane.comp.mathematics.axiom.user
Message-ID <[email protected]>
>it is axiom which is at fault, or at least the expression parsing of it.
>Since factor clearly is only applied to the second term in the list, it
>shouldn't be applied to the first.  And I shouldn't have to coerce n to type
>String, Symbol etc to force nonfactoring.

Axiom's type system, like any type system, forces you to understand
what your expression means. In your original case you are asking to
create a list object. Lists have a single type based on their
contents. The full type of the list is List Factored Integer
so all of the elements are of the same type.

Axiom correctly resolved to the lowest common point in the type tower
and this is both the correct and expected behavior. 

If you want a List Any immediately you could construct one as in:

m:List Any:=nil
for n in 10..30 repeat output concat(i,concat(j,m))

or, more concisely:

for n in 10..30 repeat output [n::Any, factor(2^n-1)]

Tim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.