At 11:24 AM 8/4/00 -0800, Michael Fowler wrote:
>On Fri, Aug 04, 2000 at 03:13:24PM -0000, Perl6 RFC Librarian wrote:
> > co foo { ... }
>
> > my $x = co { ... }
> >
> > $y = <|foo>;
> >
> > print |$x "hello, world\n";
> >
> > Inside a coroutine, the meanings of "<>" and the default file
> > descriptor for print, printf, etc. are overloaded.
>
>Is it just me, or does this look like a tied filehandle with some extra
>syntactic sugar and a user-defined subroutine?
No, there's more than that. When the coroutine does a print, it stops. When
the main code does a read from the filehandle, it stops and the coroutine
picks back up. (Well, more or less)
It's a simple form of threading, sort of. Perl's actually in both the
coroutine and the main code at the same time.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk