login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for #422 declarations escape Record revision 2 of 3

1 2 3
Editor: Bill Page
Time: 2008/05/28 16:18:30 GMT-7
Note:

changed:
-MyPair(T:Domain):Domain=Record(x:T,y:T)
MyPair(T:Domain):Domain==Record(x:T,y:T)

changed:
-MyAlt(T:Domain):Domain=Union(p:T,q:T)
MyAlt(T:Domain):Domain==Union(p:T,q:T)

Submitted by : Bill Page at: 2008-05-28T16:16:29-07:00 (15 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

This function that returns a Domain has the side-effect of declaring x and y:

axiom
MyPair(T:Domain):Domain==Record(x:T,y:T) Function declaration MyPair : Domain -> Domain has been added to workspace.
Type: Void
axiom
w:MyPair(Float) Cannot compile the declaration for x because its (possible partial) type contains a local variable. OpenAxiom will attempt to step through and interpret the code.
axiom
Compiling function MyPair with type Domain -> Domain 
   Compiled code for MyPair has been cleared.
Type: Void
axiom
x x is declared as being in Float but has not been given a value. y y is declared as being in Float but has not been given a value. w w is declared as being in Record(x: Float,y: Float) but has not been given a value.

But this does not happen for Union

axiom
MyAlt(T:Domain):Domain==Union(p:T,q:T) Function declaration MyAlt : Domain -> Domain has been added to workspace.
Type: Void
axiom
r:MyAlt(Float) Cannot compile the declaration for p because its (possible partial) type contains a local variable. OpenAxiom will attempt to step through and interpret the code.
axiom
Compiling function MyAlt with type Domain -> Domain
Type: Void
axiom
p
LatexWiki Image(1)
Type: Variable p
axiom
q
LatexWiki Image(2)
Type: Variable q
axiom
r r is declared as being in Union(p: Float,q: Float) but has not been given a value.