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

Ralf Hemmecke <[email protected]>
Newsgroups gmane.comp.mathematics.axiom.user
Message-ID <[email protected]>
Hi Alasdair,

On 02/02/2008 09:49 PM, Alasdair McAndrew wrote:
> Clearly there's more going on here than a lummox like me can follow.  I 
> would possibly argue, though, that in spite of Martin's explanation of 
> why axiom presents n in factored form in my original expression:
> 
> for n in 10..30 repeat output [n, factor(2^n-1)]
> 
> 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.
> 
> -Alasdair

I am partially on your side. If the above command outputs n in factored 
form, that should be more or less considered as a bug. (Though it is not 
as Martin explained.)

However, the function output actually requires something of type 
OutputForm as input. What you give, is not of that type, it is not even 
a list as Martin explained (you wanted a Record anyway). That basically 
leaves the interpreter with not enough information from you to do 
exactly what you wanted. So the interpreter tries to do its best to 
guess what you wanted. You cannot blame the guesser to be wrong if he 
has but one choice. And (mathematically seen) the output from the above 
command is not wrong. Why should a factored n be different from n?

Why I think that this is a bug is that Axiom should have output nothing 
but rather have stopped with an error message that there is no function 
[...] which takes an integer and a factored integer as input.

Ralf
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.