axiom-mail
[Top][All Lists]
Advanced

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

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


From: root
Subject: Re: [fricas-devel] Re: [Axiom-mail] A simple question
Date: Sat, 2 Feb 2008 17:39:41 -0500

>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







reply via email to

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