Re: Perl 6 Summary for 2004-04-26 through 2005-05-03

2005-05-04 Thread Michele Dondi
On Tue, 3 May 2005, Matt Fowles wrote: Perl 6 Summary for 2004-04-26 through 2005-05-03 ^^ ^^ Wow! Michele -- Why should I read the fucking manual? I know how to fuck! In fact the problem is that the fucking manual only gives you

Re: Junctions of classes, roles, etc.

2005-05-04 Thread Thomas Sandlaß
Abhijit Mahabal wrote: When you dispatch, what happens would depend upon WALKMETH (according to the pseudocode for CALLONE in A12). Usually the first inherited method would get called. Ohh, yes, that thing. I forget about it. And actually I hope that there's a version among the standard pragmas

Signatures and option specs [was: Open and pipe]

2005-05-04 Thread Gaal Yahas
On Mon, May 02, 2005 at 09:52:35PM +0200, Juerd wrote: I already suggested a syntax like '+$write|w' for having multiple ways to say the same thing. I don't like an explicit :mode. Let Perl figure that out based on passed named arguments. I'd like to see this specced. What you're suggesting is

Re: Signatures and option specs [was: Open and pipe]

2005-05-04 Thread Juerd
Gaal Yahas skribis 2005-05-04 13:48 (+0300): * canonical representations (eg, :w in your example should probably set $write) Or, possibly, $w := $write. * mutually exclusive options (for open modes, :write should exclude :append) I don't really care if this goes in the signature.

reduce metaoperator

2005-05-04 Thread Larry Wall
I propose that reduce become a metaoperator that can be applied to any binary operator and turns it syntactically into a list operator. I am currently thinking that the metaoperator is a prefix spelled \\ (though there are certainly lots of other possibilities that I've laid awake all night

Re: Open and pipe

2005-05-04 Thread Aaron Sherman
On Mon, 2005-05-02 at 22:51, Uri Guttman wrote: LW == Larry Wall [EMAIL PROTECTED] writes: LW multi sub opensocket ( LW Str +$mode = 'rw', LW Str +$encoding = 'auto', LW Str [EMAIL PROTECTED]) returns IO; and how will that

Re: Open and pipe

2005-05-04 Thread Aaron Sherman
On Mon, 2005-05-02 at 16:13, Mark Reed wrote: On 2005-05-02 15:52, Juerd [EMAIL PROTECTED] wrote: Gaal Yahas skribis 2005-05-02 22:25 (+0300): open 'ls', '|-'; # or even open 'ls', :pipe = 'from' I dislike the hard-to-tell-apart symbols '' and '' for modes.

Re: reduce metaoperator

2005-05-04 Thread Juerd
Are these equivalent? (Assuming reduce isn't going away) Larry Wall skribis 2005-05-04 5:36 (-0700): $sum = \\+ @array; $fact = \\* 1..$num; $sum = reduce infix:+, @arrayd; $fact = reduce infix:*, 1..$num; $firsttrue = \\|| @args; $firstdef = \\// @args;

Re: Open and pipe

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 08:47:17AM -0400, Aaron Sherman wrote: : I would expect open to be a bit of an anachronism in P6, but still : used fairly often. For the most part, I would expect that: : : my IO $read_fh = '/some/path' = 'r'; # Get an IO::File (is IO) : my IO $write_fh =

Re: reduce metaoperator

2005-05-04 Thread Juerd
Juerd skribis 2005-05-04 14:53 (+0200): @foo == zip == @bar H... @quux || || \/ @foo == zip == @bar /\ || || @xyzzy :) Juerd -- http://convolution.nl/maak_juerd_blij.html

Re: reduce metaoperator

2005-05-04 Thread Rob Kinyon
This may be a naive question, but what's wrong with just having a keyword called reduce()? Why do we need an operator for everything? I'm worried that the list of P6 operators is going to be as long as the list of P5 keywords, with a lot of them looking something like: verbdirect objectindirect

Re: reduce metaoperator

2005-05-04 Thread Aaron Sherman
On Wed, 2005-05-04 at 08:36, Larry Wall wrote: I propose that reduce become a metaoperator that can be applied to any binary operator and turns it syntactically into a list operator. Sounds very cool! I like it... but... $sum = ®+ @array; I don't think you can do that workably. In the

Re: reduce metaoperator

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 02:53:54PM +0200, Juerd wrote: : Hm, if == and == are made special syntax, maybe this would be : possible? : : @foo == zip == @bar It's already the case that == binds tighter, so it should work the same as @foo == (zip == @bar) or zip == @bar == @foo or

Re: reduce metaoperator

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 09:00:46AM -0400, Aaron Sherman wrote: : That said, let me try to be helpful, and not just complain: : : $sum = (+) @array; : : I've not thought through all of the implications to the parser, but I : think this works, and it certainly ends up looking very mnemonic

Re: reduce metaoperator

2005-05-04 Thread Juerd
Aaron Sherman skribis 2005-05-04 9:00 (-0400): $sum = ®+ @array; I don't think you can do that workably. In the font I use, I was scratching my head asking how does @ work there?! Yep, I can't tell ® and @ apart without getting REAL close to the screen. Perhaps this just means that the

Re: reduce metaoperator

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 08:59:04AM -0400, Rob Kinyon wrote: : This may be a naive question, but what's wrong with just having a : keyword called reduce()? Why do we need an operator for everything? Because it's an operator/macro in any event, with weird unary or listop parsing: reduce(+)

Re: reduce metaoperator

2005-05-04 Thread Michele Dondi
On Wed, 4 May 2005, Larry Wall wrote: I propose that reduce become a metaoperator that can be applied to any binary operator and turns it syntactically into a list operator. I second that. By all means! (But I thin it would be desirable to have a 'plain' reduce operator as well) Michele -- The

Re: Open and pipe

2005-05-04 Thread Uri Guttman
AS == Aaron Sherman [EMAIL PROTECTED] writes: AS On Mon, 2005-05-02 at 22:51, Uri Guttman wrote: LW == Larry Wall [EMAIL PROTECTED] writes: LW multi sub opensocket ( LW Str +$mode = 'rw', LW Str +$encoding = 'auto', LW Str [EMAIL PROTECTED]) returns IO; and how will that

Circular dereference?

2005-05-04 Thread Autrijus Tang
What should this do, if not infinite loop? my ($x, $y); $x = \$y; $y = \$x; $x[0] = 1; Thanks, /Autrijus/ pgplOdMgUykiv.pgp Description: PGP signature

Re: reduce metaoperator

2005-05-04 Thread Juerd
Larry Wall skribis 2005-05-04 6:10 (-0700): On Wed, May 04, 2005 at 08:59:04AM -0400, Rob Kinyon wrote: : This may be a naive question, but what's wrong with just having a : keyword called reduce()? Why do we need an operator for everything? Because it's an operator/macro in any event, with

Re: reduce metaoperator

2005-05-04 Thread Rob Kinyon
Using that argument, every keyword is really an operator/macro. Instead of sub/method/multimethod, we could use a special character. sub foo { ... } becomes foo { ... } A method is , a multimethod is *, and so on. (I don't have a Unicode mail client or I'd look for a Unicode character.) What

Re: reduce metaoperator

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 02:58:14PM +0200, Juerd wrote: : Juerd skribis 2005-05-04 14:53 (+0200): : @foo == zip == @bar : : H... : :@quux : || : || : \/ : @foo == zip == @bar : /\ : || : ||

Re: Circular dereference?

2005-05-04 Thread Juerd
Autrijus Tang skribis 2005-05-04 21:13 (+0800): What should this do, if not infinite loop? my ($x, $y); $x = \$y; $y = \$x; $x[0] = 1; I'm still against any explict scalar dereferencing, so: fail, complaining about $x not being an arrayreference (not knowing how to handle postcircumfix:[

Re: reduce metaoperator

2005-05-04 Thread Uri Guttman
LW == Larry Wall [EMAIL PROTECTED] writes: LW I propose that reduce become a metaoperator that can be applied to LW any binary operator and turns it syntactically into a list operator. LW I am currently thinking that the metaoperator is a prefix spelled \\ LW (though there are certainly

Re: Circular dereference?

2005-05-04 Thread Juerd
Juerd skribis 2005-05-04 15:18 (+0200): I'm still against any explict scalar dereferencing, so: fail, complaining about $x not being an arrayreference (not knowing how to handle postcircumfix:[ ]). Ehm :) s/explicit/implicit/ Juerd -- http://convolution.nl/maak_juerd_blij.html

Re: reduce metaoperator

2005-05-04 Thread Uri Guttman
J == Juerd [EMAIL PROTECTED] writes: J Juerd skribis 2005-05-04 14:53 (+0200): @foo == zip == @bar J H... J@quux J || J || J \/ J @foo == zip == @bar J /\ J || J || J

Re: Circular dereference?

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 03:18:29PM +0200, Juerd wrote: : Autrijus Tang skribis 2005-05-04 21:13 (+0800): : What should this do, if not infinite loop? : my ($x, $y); $x = \$y; $y = \$x; $x[0] = 1; : : I'm still against any explict scalar dereferencing, so: fail, : complaining about $x not

Re: reduce metaoperator

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 09:18:46AM -0400, Uri Guttman wrote: : LW == Larry Wall [EMAIL PROTECTED] writes: : LW $fact = \\* 1..$num; : : shouldn't that be s/fact/prod/ ? sure the input makes it a factorial but : the general case would be a product. not that what var names you choose :

Re: reduce metaoperator

2005-05-04 Thread Aaron Sherman
On Wed, 2005-05-04 at 09:06, Larry Wall wrote: On Wed, May 04, 2005 at 09:00:46AM -0400, Aaron Sherman wrote: : That said, let me try to be helpful, and not just complain: : : $sum = (+) @array; It's certainly one of the ones I considered, along with all the other brackets, and |+|,

Re: reduce metaoperator

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 03:15:09PM +0200, Juerd wrote: : Larry Wall skribis 2005-05-04 6:10 (-0700): : On Wed, May 04, 2005 at 08:59:04AM -0400, Rob Kinyon wrote: : : This may be a naive question, but what's wrong with just having a : : keyword called reduce()? Why do we need an operator for

Re: reduce metaoperator

2005-05-04 Thread Juerd
Uri Guttman skribis 2005-05-04 9:23 (-0400): you are brainfucking me! stop it now!! +++[++-]+++.[-]. [-]-.---.+++[+++-].+ ++[---]+..+++[+++-].+..+++[---] .-.+...[+-]++.+++[--]

Re: reduce metaoperator

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 09:34:28AM -0400, Aaron Sherman wrote: : On Wed, 2005-05-04 at 09:06, Larry Wall wrote: : On Wed, May 04, 2005 at 09:00:46AM -0400, Aaron Sherman wrote: : : That said, let me try to be helpful, and not just complain: : : : : $sum = (+) @array; : : It's certainly

Re: Circular dereference?

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 09:38:58PM +0800, Autrijus Tang wrote: : On Wed, May 04, 2005 at 06:24:34AM -0700, Larry Wall wrote: : Yes, it doesn't immediately deref as an array, so it fails. : : Oh. So autodereference is only one level? I got it all wrong : in Pugs, then. I wonder where I got

Re: reduce metaoperator

2005-05-04 Thread Aaron Sherman
On Wed, 2005-05-04 at 09:23, Uri Guttman wrote: J == Juerd [EMAIL PROTECTED] writes: J Juerd skribis 2005-05-04 14:53 (+0200): @foo == zip == @bar J H... J@quux J || J || J \/ J @foo == zip == @bar J

Re: reduce metaoperator

2005-05-04 Thread Aaron Sherman
On Wed, 2005-05-04 at 09:45, Larry Wall wrote: On Wed, May 04, 2005 at 09:34:28AM -0400, Aaron Sherman wrote: : Hmmm... : : $sum = [+] @array : : Nice. I just thought that'd be visually confusing in a subscript: @foo[0..9; [;[EMAIL PROTECTED]; 0..9] Now, why did I think you

Re: Coroutine Question

2005-05-04 Thread Aaron Sherman
On Wed, 2005-05-04 at 09:47, Joshua Gatcomb wrote: So without asking for S17 in its entirety to be written, is it possible to get a synopsis of how p6 will do coroutines? A coroutine is just a functional unit that can be re-started after a previous return, so I would expect that in Perl, a

Re: Coroutine Question

2005-05-04 Thread Joshua Gatcomb
On 5/4/05, Luke Palmer [EMAIL PROTECTED] wrote: On 5/4/05, Joshua Gatcomb [EMAIL PROTECTED] wrote: So without asking for S17 in its entirety to be written, is it possible to get a synopsis of how p6 will do coroutines? I ask because after reading Dan's What the heck is: a coroutine, it is

Re: Cmmposition binop

2005-05-04 Thread Stuart Cook
What I refer to now is something that takes two {coderefs,anonymous subs,closures} and returns (an object that behaves like) another anonymous sub, precisely the one that acts like the former followed by the latter (or vice versa!). Do you mean like the mathematical 'f o g'? i.e. (f o g)($x)

Re: Cmmposition binop

2005-05-04 Thread Rob Kinyon
What about the function compose() that would live in the module keyword, imported by the incantation use keyword qw( compose );? (NB: My P6-fu sucks right now) multimethod compose (@*List) { return { $_() for @List; }; } On 5/4/05, Michele Dondi [EMAIL PROTECTED] wrote: I had

Coroutine Question

2005-05-04 Thread Luke Palmer
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

Re: Open and pipe

2005-05-04 Thread Gaal Yahas
On Wed, May 04, 2005 at 08:47:17AM -0400, Aaron Sherman wrote: I would expect open to be a bit of an anachronism in P6, but still used fairly often. For the most part, I would expect that: my IO $read_fh = '/some/path' = 'r'; # Get an IO::File (is IO) my IO $write_fh =

Re: Coroutine Question

2005-05-04 Thread Ingo Blechschmidt
Hi, Joshua Gatcomb wrote: On 5/4/05, Luke Palmer [EMAIL PROTECTED] wrote: On 5/4/05, Joshua Gatcomb [EMAIL PROTECTED] wrote: So without asking for S17 in its entirety to be written, is it possible to get a synopsis of how p6 will do coroutines? I ask because after reading Dan's What the

Re: Coroutine Question

2005-05-04 Thread Joshua Gatcomb
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;

Re: Coroutine Question

2005-05-04 Thread Aaron Sherman
On Wed, 2005-05-04 at 10:07, Aaron Sherman wrote: On Wed, 2005-05-04 at 09:47, Joshua Gatcomb wrote: So without asking for S17 in its entirety to be written, is it possible to get a synopsis of how p6 will do coroutines? A coroutine is just a functional unit that can be re-started after

Re: Cmmposition binop

2005-05-04 Thread Ingo Blechschmidt
Hi, Rob Kinyon wrote: What about the function compose() that would live in the module keyword, imported by the incantation use keyword qw( compose );? FWIW, I like o better -- function composing is very often used in FP, and should therefore have a short name. Luckily, it's very easy to

Plethora of operators

2005-05-04 Thread Rob Kinyon
I just started following the list again after a few months (though I have been skimming the bi-weekly summaries) and I'm a little alarmed at what seems to be a trend towards operaterizing everything in sight and putting those operators in the core. My understanding of P6 after the reading the AES

Re: Open and pipe

2005-05-04 Thread Juerd
Gaal Yahas skribis 2005-05-04 17:24 (+0300): Ah yes, that's another thing I was wondering about: what does opening a pipe return. If it's a one-way pipe, okay, this may be a single handle; but for bidirectional opens, we need $in, $out, and $err handles; and That'd be tridirectional, then. A

Re: Open and pipe

2005-05-04 Thread Rob Kinyon
Would that mean that a filehandle opened readonly would throw an exception if you attempted to either print or warn on it? On 5/4/05, Juerd [EMAIL PROTECTED] wrote: Gaal Yahas skribis 2005-05-04 17:24 (+0300): Ah yes, that's another thing I was wondering about: what does opening a pipe

Re: Open and pipe

2005-05-04 Thread Gaal Yahas
On Wed, May 04, 2005 at 04:59:21PM +0200, Juerd wrote: Ah yes, that's another thing I was wondering about: what does opening a pipe return. If it's a one-way pipe, okay, this may be a single handle; but for bidirectional opens, we need $in, $out, and $err handles; and That'd be

Re: Open and pipe

2005-05-04 Thread Juerd
Rob Kinyon skribis 2005-05-04 11:02 (-0400): Would that mean that a filehandle opened readonly would throw an exception if you attempted to either print or warn on it? I don't know what warning on a filehandle should be or do, but ignoring that bit, yes, an exception would be the right thing to

Re: Open and pipe

2005-05-04 Thread Juerd
Gaal Yahas skribis 2005-05-04 18:15 (+0300): Yes, if $h is the not-very-primitive version of IO. Surely the type of $h.in is not the same as $h itself? Why not? $h does IO::Handle::Tridirectional, and $h.in does not, even though $h and $h.in are-a IO::Handle. Or whatever the classes will be,

Re: Open and pipe

2005-05-04 Thread Rob Kinyon
Rob Kinyon skribis 2005-05-04 11:02 (-0400): Would that mean that a filehandle opened readonly would throw an exception if you attempted to either print or warn on it? I don't know what warning on a filehandle should be or do, but ignoring that bit, yes, an exception would be the right

Re: Open and pipe

2005-05-04 Thread Juerd
Rob Kinyon skribis 2005-05-04 11:20 (-0400): $h.print() goes to $h.out $h.readline() goes to $h.in $h.warn() goes to $h.err Making the tri-directional trifecta complete. It's sort-of consistent, but I don't like it, because warnings are much more complicated than just things that are printed

Re: Circular dereference?

2005-05-04 Thread Thomas Sandlaß
Autrijus Tang wrote: What should this do, if not infinite loop? my ($x, $y); $x = \$y; $y = \$x; $x[0] = 1; Hmm, after the my both $x and $y store an undef. Then $x stores a ref to undef. Then $y stores a ref to ref of undef. I see no circle. Now let's look at $x = 1. I think it goes down to

Re: Circular dereference?

2005-05-04 Thread Autrijus Tang
On Wed, May 04, 2005 at 05:30:48PM +0200, Thomas Sandla wrote: Autrijus Tang wrote: What should this do, if not infinite loop? my ($x, $y); $x = \$y; $y = \$x; $x[0] = 1; Hmm, after the my both $x and $y store an undef. Then $x stores a ref to undef. Then $y stores a ref to ref of

Re: Circular dereference?

2005-05-04 Thread Thomas Sandlaß
Autrijus Tang wrote: If the reference semantics changed drastically, please reflect it prominiently in the relevant Synopsis. :) Unfortunately I don't feel entitled to do so. I'm just an interessted bystander, not a member of the design team. Sorry. -- TSa (Thomas Sandlaß)

Re: reduce metaoperator

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 09:55:57AM -0400, Aaron Sherman wrote: : I don't think there's a perfect solution for what you want, but this is : pretty darned close. Yes, and I was always a little fond of the bracket solution since it lets you visually distinguish $x = [»+«] @foo; $x = [+]«

Re: Circular dereference?

2005-05-04 Thread Juerd
Thomas Sandlaß skribis 2005-05-04 17:30 (+0200): my ($x, $y); $x = \$y; $y = \$x; $x[0] = 1; Hmm, after the my both $x and $y store an undef. Then $x stores a ref to undef. Then $y stores a ref to ref of undef. I see no circle. No, again, please do not make the mistake of thinking VALUES

Re: Circular dereference?

2005-05-04 Thread Aaron Sherman
On Wed, 2005-05-04 at 11:30, Thomas Sandlaß wrote: Autrijus Tang wrote: What should this do, if not infinite loop? my ($x, $y); $x = \$y; $y = \$x; $x[0] = 1; Hmm, after the my both $x and $y store an undef. Then $x stores a ref to undef. Then $y stores a ref to ref of undef. I

Re: Plethora of operators

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 10:58:22AM -0400, Rob Kinyon wrote: : I just started following the list again after a few months (though I : have been skimming the bi-weekly summaries) and I'm a little alarmed : at what seems to be a trend towards operaterizing everything in sight : and putting those

Re: Open and pipe

2005-05-04 Thread Uri Guttman
J == Juerd [EMAIL PROTECTED] writes: J Rob Kinyon skribis 2005-05-04 11:20 (-0400): $h.print() goes to $h.out $h.readline() goes to $h.in $h.warn() goes to $h.err Making the tri-directional trifecta complete. J It's sort-of consistent, but I don't like it, because warnings are

Re: Plethora of operators

2005-05-04 Thread Rob Kinyon
Are there any particular other operators you're worried about? I think the current design does a pretty good job of factoring out the metaoperators so that the actual set of underlying basic operators *is* relatively small. Yes, you can now say something like $x = [»+^=«] @foo; but

Re: Coroutine Question

2005-05-04 Thread John Macdonald
On Wed, May 04, 2005 at 10:43:22AM -0400, Aaron Sherman wrote: On Wed, 2005-05-04 at 10:07, Aaron Sherman wrote: On Wed, 2005-05-04 at 09:47, Joshua Gatcomb wrote: So without asking for S17 in its entirety to be written, is it possible to get a synopsis of how p6 will do coroutines?

Re: Circular dereference?

2005-05-04 Thread Thomas Sandlaß
Aaron Sherman wrote: Squint harder ;-) I'm trying! If we agree that the first say should print 7, then we must conclude that either we've changed the value of undef to 7, or we've created a circular reference. In my view of refs 7 is printed, indeed. But I've difficulty to understand what you

Re: Coroutine Question

2005-05-04 Thread Patrick R. Michaud
On Wed, May 04, 2005 at 02:22:43PM -0400, John Macdonald wrote: On Wed, May 04, 2005 at 10:43:22AM -0400, Aaron Sherman wrote: On Wed, 2005-05-04 at 10:07, Aaron Sherman wrote: A coroutine is just a functional unit that can be re-started after a previous return, so I would expect that in

Re: Type system questions.

2005-05-04 Thread Larry Wall
On Tue, May 03, 2005 at 09:53:59PM +0800, Autrijus Tang wrote: : On Tue, May 03, 2005 at 05:32:44AM -0700, Larry Wall wrote: : : # Type Instantiation? : : sub apply (fun::a returns ::b, ::a $arg) returns ::b { : : fun($arg); : : } : : The first parameter would be fun:(::a)

Re: Coroutine Question

2005-05-04 Thread Rod Adams
John Macdonald wrote: The most common (and what people sometimes believe the *only* usage) is as a generator - a coroutime which creates a sequence of values as its chunk and always returns control to its caller. (This retains part of the subordinate aspect of a subroutine. While it has the

Re: Coroutine Question

2005-05-04 Thread Damian Conway
[Not back, just sufficiently irritated...] Luke Palmer wrote: in my proposal, when you call a coroutine, it returns an iterator (and doesn't call anything): my $example = example(); =$example; # 1 =$example; # 2 The thing this buys over the traditional (which I refer to as the

Re: Coroutine Question

2005-05-04 Thread John Macdonald
On Wed, May 04, 2005 at 03:02:41PM -0500, Rod Adams wrote: John Macdonald wrote: The most common (and what people sometimes believe the *only* usage) is as a generator - a coroutime which creates a sequence of values as its chunk and always returns control to its caller. (This retains part

Re: Coroutine Question

2005-05-04 Thread Damian Conway
John Macdonald wrote a lovely summary of coroutines [omitted]. Then added: I'd use resume instead of coreturn We've generally said we'd be using yield. and the interface for resume would allow values to be sent in as well as out. Indeed. As John suggested, the yield keyword (or whatever we call

Re: Coroutine Question

2005-05-04 Thread Rod Adams
John Macdonald wrote: On Wed, May 04, 2005 at 03:02:41PM -0500, Rod Adams wrote: If there are good uses for coroutines that given/take does not address, I'll gladly change my opinion. But I'd like to see some examples. FWIW, I believe that Patrick's example of the PGE returning matches could

Re: reduce metaoperator

2005-05-04 Thread John Williams
$sum = reduce(+) @array; # macro $sum = reduce infix:+ @array; # regular sub $sum = [+] @array; # meta operator ($sum = 0) += @array;# hyper tricks use My::Cool::Reduce::Mixin; # unless in core $sum = @array.reduce(+); #

Re: Coroutine Question

2005-05-04 Thread John Macdonald
On May 4, 2005 06:22 pm, Rod Adams wrote: John Macdonald wrote: On Wed, May 04, 2005 at 03:02:41PM -0500, Rod Adams wrote: If there are good uses for coroutines that given/take does not address, I'll gladly change my opinion. But I'd like to see some examples. FWIW, I believe that

When scoping

2005-05-04 Thread Luke Palmer
What should the output of this be: given hello { when /hello/ { say One; when /hello/ { say Two; } when /hello/ { say Three; } continue; } say Four; } I think: One Two Three Four But pugs thinks:

stdio

2005-05-04 Thread Gaal Yahas
How do I open a file named -? How do I open stdout (and the other standard handles)? -- Gaal Yahas [EMAIL PROTECTED] http://gaal.livejournal.com/

Re: reduce metaoperator

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 09:55:31PM -0600, John Williams wrote: :$sum = reduce(+) @array; # macro That one suffers the operator/term confusion I mentioned earlier. :$sum = reduce infix:+ @array; # regular sub That one's complicated enough that you actually installed a syntax

Re: When scoping

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 11:00:31PM -0600, Luke Palmer wrote: : What should the output of this be: : : given hello { : when /hello/ { : say One; : when /hello/ { say Two; } : when /hello/ { say Three; } : continue; : } :

Re: reduce metaoperator

2005-05-04 Thread Luke Palmer
On 5/4/05, Larry Wall [EMAIL PROTECTED] wrote: [] could mean monotonically increasing. Not unless we make boolean operators magic. There are arguments for doing that, but I don't really want to think about how that would be done at the moment. Reduce over a straight-up (or left) boolean