axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] "has" and "with" and bug


From: William Sit
Subject: Re: [Axiom-developer] "has" and "with" and bug
Date: Mon, 13 Aug 2007 11:18:25 -0400

Ralf Hemmecke wrote:

> Let's compile and run the program below.
>
> woodpecker:~/scratch>aldor -laldor -grun aaa.as
> has with {foo: ()->()} = T
> has with {bar: ()->()} = T
> has with {rhx: ()->()} = T
> has with {foo: ()->()} = T
> has with {bar: ()->()} = T
> has with {rhx: ()->()} = T
> MDom has rhx? T
>
> Ooops. I must say that is surprising. MDom exports foo, bar, ans, but
> not rhx.

Why does that surprise you? Even though rhx is not exported,
it is recorded as part of |catExports|, because according to your
quote from AUG:

> AUG Chp. 7.8:
>
>    The type of the expression A add B is C with { x1: T1; ...; xn: Tn }
>    where C is the type of A, and x1,...,xn are the symbols defined
>    (using ==) in B, whose types are T1,...,Tn, respectively.

This means all local functions (defined in B, but not declared in the with 
clause
explicitly) are now declared in a with clause??

and on Mon, 13 Aug 2007 10:35:23 +0200, you wrote:

> A with B is (or should be) completely equivalent to:
>
>     with {A; B}
>
> (see Aldor User Guide). And perhaps that is also a hint to the
> named/unamed problem. What appears inside with will be recorded
> internally. [...]

So rhx is recorded as part of |catExports|? Can you check the compiled code?

> What I believe "has" does, is to look inside the |catExports| and checks
> whether the symbol is there.

So MDom has rhx? T seems to me to be according to AUG.

William





reply via email to

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