[m-users.] spawn in Rosettacode

Robert Smart robert.kenneth.smart at gmail.com
Sun Aug 31 14:39:36 AEST 2014


Thanks Mark. I've put a link a link to your email in my blog post on the
subject (
http://wombatlang.blogspot.com.au/2014/08/lazyness-backtracking-and-explicit-io.html).
Mistakes in my post will be quickly fixed. I look forward to understanding
it all better one day!

rks


On Sat, Aug 30, 2014 at 5:39 PM, Julien Fischer <jfischer at opturion.com>
wrote:

>
> Hi Robert,
>
>
> On Sat, 30 Aug 2014, Robert Smart wrote:
>
>  I don't see print_cc/1.
>>
>
> It's in the io module; listed just after io.print.
>
>
>  I assumed that print_cc("Rosetta\n") was a sort of partial application
>> and that spawn would complete that with the !IO parameters.
>>
>
> princ_cc("Rosetta\n") is just a normal curried higher-order term.
> The intesting bit here is spawn/3.  The library manual's explanation is:
>
>     spawn(Closure, IO0, IO) is true iff `IO0' denotes a list of I/O
>     transactions that is an interleaving of those performed by
>     `Closure' and those contained in `IO' - the list of transactions
> performed
>     by the continuation of spawn/3.
>
>
>  Somebody could add some of this explanation to the rosettacode example
>> which is currently rather bare.
>>
>
> Ok, I'll do that.
>
>
>  Also the info on how to compile it.
>>
>
>     $ mmc concurrent_computing.m
>
> Since most grades support some form of concurrency that should be it.
> (For those grades that don't a runtime error will occur.)
>
> Cheers,
> Julien.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20140831/e7272e09/attachment.html>


More information about the users mailing list