On Wed, Apr 27, 2005 at 08:21:27AM -0000, Rafael Garcia-Suarez wrote: > Autrijus Tang wrote in perl.perl6.language : > > > > 4. Software Transaction Memory > > In Fortress, there is also an `atomic` trait for functions, that > > declares the entire function as atomic. > > Interesting; and this rolling-back approach avoids the deadlock issues > raised by the use of semaphores (like in Java's synchronization > approach). > > But, as the slides point out, you can't do I/O or syscalls from an > atomic function; and in Haskell you can ensure that with the wise use of > monads. Perl 6 has no monads, last time I checked...
In Haskell there is an unsafeIOtoSTM call that lets you do IO inside the atomic function; it's just that the IO is unsafe; it will be run repeatedly and cannot be rolled back. I can certainly see a `is pure` trait on Perl 6 function that declares them to be safe from side effects. In a sense, `is const` also does that. Thanks, /Autrijus/
Description: PGP signature