mark richardson wrote:
> Hi,
>
> I have been trying to understand something unusual and I wonder if
> anyone can shed any light on this.
>
> If I feed this program
>
> declare
> {Browse {Plus 5 5}}
> fun {Plus A B} A+B end
>
> by buffer, the program blocks on the Browse procedure (I assume
> because 'Plus' has not yet been determined?)
>
> If however, I now feed a new line
>
> fun {Plus A B} A+B+A end
>
> I get an error saying that Plus has already been defined (which
> initially seems sensible)
>
> Tell: <P/3 Plus> = <P/3 Plus>
>
> but, and here is the confusing thing, the browser now displays the
> result from the second function????

easy:

1. Browse blocks the thread, because Plus is unbound
2. In a separate thread you bind Plus (declared in the first thread) to
a procedure
3. Browse unblocks
4. You now reach the function definition in the first thread, which
causes unification failure.

or at least it seems so.

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

Reply via email to