Abuzar Chaudhary writes:
 > Fellow Witches,
 > 
 > I'm ploughing my way through the tutorial.  At the end of this section:
 > 
 > http://www.mozart-oz.org/documentation/tutorial/node5.html#control.anonymous
 > 
 > there exists this code:
 > 
 >     local 
 >        Y = 1
 >     in 
 >        local 
 >           M = f(M Y)
 >           [X1 !Y] = L
 >           L = [1 2]
 >        in {Browse [M L]}
 >        end 
 >     end
 > 
 > which (upon clicking oz/feed paragraph) produces this error:
 > 
 > %********************** static analysis error *******************
 > %**
 > %** equality constraint failed
 > %**
 > %** First value:             1
 > %** Second value:            2
 > %** Original assertion:      [X1<optimized> 1] = [1 2]
 > %** Offending expression in: file "Oz", line 2, column 11
 > %** in file "Oz", line 7, column 14
 > %** ------------------ rejected (1 error)
 > 
 > Is this how the Almighty meant the world to be understood, or has this
 > lowly worthless disciple misunderstood the marvels of the goddesses.
 > 

Hi Abuzar,

In the lines:

           [X1 !Y] = L
           L = [1 2]

X1 is fresh but (because of the exclamation mark) !Y is the same
variable as the outer Y which has already been bound to 1.

In the second line when we try to unify [X1 1] with [1 2] we fail
because we cannot unify 1 with 2.

So the result is correct for this program, it would be helpful if the
tutorial explained that this is expected :-(

k



_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to