Dear Wolfgang,

On Tue, Mar 24, 2009 at 9:48 PM, Wolfgang Meyer <[email protected]>wrote:

>
> I also like this short version of the code which I found in the Mozart
> sources a while ago:
>
> declare
> P
> thread
>  for Msg in {NewPort $ P} do
>   {Browse Msg}
>  end
> end


The following version is even shorter.  But you have to think a bit to
understand why and how it works ;-)

declare
P={NewPort thread {ForAll $ Browse} end}

The thread ... end defines a concurrent expression that returns the list
variable that the ForAll loop traverses.  That variable is then bound to the
stream of the port.

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

Reply via email to