[Top][All Lists]

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

[Axiom-developer] Cast = pretend in Spad/Aldor? (was: B#)

From: Bill Page
Subject: [Axiom-developer] Cast = pretend in Spad/Aldor? (was: B#)
Date: Mon, 21 Nov 2005 14:27:43 -0500

On November 21, 2005 12:59 PM Gaby wrote:

> "Bill Page" writes:
> | On November 20, 2005 11:50 PM Gaby wrote:
> | > | 
> | > | We have mentioned before on this list the very good article
> | > | 
> | > |
> | > | 
> | > 
> | > That is interesting but the link above is confused to start
> | > with. I quote: 
> | > 
> | >    An example of the absence of strong typing is a C cast 
> | >    gone wrong; if you cast a value in C, not only is the
> | >    compiler required to allow the code, but the runtime is
> | >    expected to allow it as well.
> | > 
> ...

Actually, perhaps I should simply concede that the above
article is not particularly good, and I will be glad to do
so if you can recommend a better alternative that defines
these terms more accurately.

But really I don't want to be spending a lot of time arguing
about the merits of the C programming language on this list.
What I would really like to think about is strong static typing
in the context of Axiom, specifically in Spad and in Aldor.

There is one very important type-related construction in
Spad and in Aldor that looks as if it might make them "weak"
in the sense in which the author of the above quote implies
the use of cast in the C language makes it weak. That is the
use of 'pretend'.

It is pretty clear in the following example that the Axiom
interpreter does something odd:

(1) -> I:Integer
                                                Type: Void
(2) -> F:Float:=1.0

   (2)  1.0
                                                Type: Float
(3) -> I := F pretend Integer

   (3)  1()
                                                Type: Integer


Yet the ability to use 'pretend' is critical to the concept
of representation in the construction of Axiom domains.

For a perhaps overly abstract discussion of this see:

So my question is: Does this feature of the Spad and Aldor
languages actually make them "weakly typed"?

Bill Page.

reply via email to

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