axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] The symbol 4 (was Re: Aldor and Axiom)


From: Martin Rubey
Subject: Re: [Axiom-developer] The symbol 4 (was Re: Aldor and Axiom)
Date: 15 Feb 2006 10:25:59 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Ralf Hemmecke <address@hidden> writes:

> > What other kinds of integers are there? But the symbol 4 can certainly
> > stand for other things besides the integer 4.
> 
> Right. 4 is just a symbol consisting of three strokes. If one doesn't bring it
> into a context its meaning would be totally unclear. Well, nowadays humans 
> tend
> to interpret this always as an integer, but I think several thousand years ago
> that was not so clear.

Gaussian Integers was a joke, of course. (of course, I'm speaking only for my
response and not for Jay's)

However, the "guessing" of types in Axiom is tremendously useful and without
it, I probably would stop using it. Note that MuPAD does no type guessing, and
thus leaves people in fact with the expression domain by default.

Of course (!!!), type guessing may only be done by the interpreter. As far as I
know, the compiler does no guessing - at least not intentionally. (It uses the
types currently in scope, which may be dangerous at times, too, but that's a
different matter)

I repeat, because I think it's important:

* Type guessing should by done by the interpreter and only by the interpreter.*

The strategy is of course, to take the most "natural" type. I think the Axiom
book somewhere says, the most narrow possible type. This explains the
preference of PI over NNI over INT. Of course it does not explain why it would
not chose PF 5, so I tend to think that it is necessarily hard-coded
information, possibly in a database.

Still, as a mathematician I must say that I wouldn't want to live without
it. In fact, I even struggled to write my guessing package in a way so that the
package parameters can be guessed by the interpreter, which means that one only
has to type the list of numbers which one wants to guess and not the 10
parameters of the package call. Of course, once in a 100 times one may want to
override the defaults, but this is not a problem.

And in most cases, the problem "Oh, Axiom chose a different type than I had in
mind" does not occur, because the interpreter gives quite a lot of feedback.

I do know that there are constructions where type guessing may produce
different results, but I tend to believe that these situations are rare, can be
avoided with a well done library and do not justify giving up this help
altogether.

Martin





reply via email to

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