Browse
Torsten Anders
torsten.anders at plymouth.ac.uk
Wed Sep 12 12:33:19 CEST 2007
Dear Wacek,
as far as I remember (haven't found the relevant docs right now),
declare starts a compilation unit, and multiple compilation units are
executed concurrently by default. So, the order in which they are
executed is indetermined in your example.
Rule of thumb: don't use multiple instances of declare in a single
code feed ;-)
Best
Torsten
On Sep 12, 2007, at 10:21 AM, Wacek Kusnierczyk wrote:
> Hi,
>
> I observe unexpected behaviour when running a simple piece of code.
> Consider this programlet:
>
> declare
> V = 'stop'
> proc {P} {Browse V} end
> local V='start' in {Browse V} {P} end
> {P}
>
> This displays start, stop, stop, in this order, as expected.
> The funnyart is when the code is modified as follows:
>
>
> declare
> V = 'stop'
> proc {P} {Browse V} end
> local V='start' in {Browse V} {P} end
> declare
> V = 'whatever else'
> {P}
>
> Here, on the first run stop, start, stop is displayed, but on any
> subsequent run the order is again as above, as expected. On the first
> run, the last Browse is the first to actually display -- why? (To see
> that, redefine P to, e.g., proc {P Q} {Browse P#Q} end and call P with
> different values on each occasion.)
>
> (Mozart 1.3.2, Fedora)
>
> vQ
>
> ______________________________________________________________________
> ___________
> mozart-users mailing list mozart-
> users at mozart-oz.org
> http://www.mozart-oz.org/mailman/listinfo/mozart-users
--
Torsten Anders
Interdisciplinary Centre for Computer Music Research
University of Plymouth
http://strasheela.sourceforge.net
http://www.torsten-anders.de
More information about the mozart-users
mailing list