On 5/4/05, Luke Palmer <[EMAIL PROTECTED]> wrote:
> On 5/4/05, Joshua Gatcomb <[EMAIL PROTECTED]> wrote:
> > Ok - this isn't what I was expecting at all. That doesn't make it a
> > bad thing. Given something that looks a lot more like a typical
> > coroutine:
> >
> > sub example is coroutine {
> > yield 1;
> > yield 2;
> > yield 3;
> > }
> >
> > I would expect
> > for 1 .. 5 { say example() } to print "1\n2\n3\n1\n\2"
>
> Ding! You just hit the disagreement point. You're on Damian's side.
Not exactly. I am basing my expectation on the following link and
then asking with all the different ways to define behavior - has a
decision WRT p6 been made.
http://www.sidhe.org/~dan/blog/archives/000178.html
> Sorry for my language... it's just that if I were dropped into a
> project that invented that abstraction for something it was doing, it
> would be one of the first things I'd change. Totally unscalable
> design.
>
> > If I got fancy and added a parameter
> >
> > sub example ( $num ) is coroutine {
> > yield $num;
> > yield $num + 1;
> > yield $num - 2;
> > }
> >
> > I would expect
> > for 1 .. 5 { say example( 7 ) } to print "7\n8\n6\n7\n8";
>
> And here is where it gets trickier:
>
> say example(7); # 7
> say example(7); # 8
> say example(8); # 8? 6?
Exactly my point. There is more than one way to define the behavior
(especially with parameter handling). That is why I included a
reference and asked how p6 was going to do it. Personally, I don't
care because I know people like you, Larry, Damian, et all will make a
sound decision. What I want to know is if you have a decision already
that isn't published in its entirety so I can start writing tests.
Ok, I do care. Regardless of behavior, I would hope the syntax would
somewhat resemble that of other languages.
>
> Luke
>
Cheers,
Joshua Gatcomb
a.k.a. L~R