[m-users.] spawn in Rosettacode
jfischer at opturion.com
Sat Aug 30 17:39:46 AEST 2014
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.)
More information about the users