explicitly declare closures???

2001-08-21 Thread Dave Mitchell
Just thought I'd run the following up the flagpole to see if anyone laughs at it Closures are useful, powerful things, but they can also be dangerous and counter-intuitive, espcially to the uninitiated. For example, how many people could say what the following should output, with and without

RE: HOw to Unsub

2001-08-21 Thread Sterin, Ilya
Usually the generic way is to send email to [EMAIL PROTECTED], so in your case try [EMAIL PROTECTED] Ilya -Original Message- From: Patel, Sharad To: Eric Roode; [EMAIL PROTECTED] Sent: 08/21/2001 7:22 AM Subject: HOw to Unsub HI Guys Sorry for this but I need to know how to Unsubscribe

Re: explicitly declare closures???

2001-08-21 Thread John Porter
Dave Mitchell wrote: > ie by default lexicals are only in scope in their own sub, not within > nested subs - and you have to explicitly 'import' them to use them. No. People who write closures know what they're doing. When's the last time someone "accidentally" wrote a closure? -- John Porte

Re: explicitly declare closures???

2001-08-21 Thread Eric Roode
John Porter wrote: > >Dave Mitchell wrote: >> ie by default lexicals are only in scope in their own sub, not within >> nested subs - and you have to explicitly 'import' them to use them. > >No. People who write closures know what they're doing. > >When's the last time someone "accidentally" wrote

HOw to Unsub

2001-08-21 Thread Patel, Sharad
HI Guys Sorry for this but I need to know how to Unsubscribe. Any ideas ?? Regards -Original Message- From: Eric Roode [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 21, 2001 2:22 PM To: [EMAIL PROTECTED] Subject: Re: explicitly declare closures??? John Porter wrote: > >Dave Mitche

Re: explicitly declare closures???

2001-08-21 Thread Graham Barr
On Tue, Aug 21, 2001 at 09:21:35AM -0400, Eric Roode wrote: > John Porter wrote: > > > >Dave Mitchell wrote: > >> ie by default lexicals are only in scope in their own sub, not within > >> nested subs - and you have to explicitly 'import' them to use them. > > > >No. People who write closures kno

Re: explicitly declare closures???

2001-08-21 Thread Piers Cawley
Dave Mitchell <[EMAIL PROTECTED]> writes: > Just thought I'd run the following up the flagpole to see if anyone > laughs at it > > Closures are useful, powerful things, but they can also be > dangerous and counter-intuitive, espcially to the uninitiated. For example, > how many people could

Re: explicitly declare closures???

2001-08-21 Thread Dave Mitchell
Piers Cawley <[EMAIL PROTECTED]> wrote: > > { > > my $x = "bar"; > > sub foo { > > # $x # <- uncommenting this line changes the outcome > > return sub {$x}; > > } > > } > > print foo()->(); > > Well, I would expect it to output 'foo' on both occasions, and I'm > more than a l

Re: explicitly declare closures???

2001-08-21 Thread John Porter
Dave Mitchell wrote: > foo() is a closure created at compile time. By the time the main {} block > has been executed (but before foo() is called), the $outer:x is undef, > and $foo:x is 'bar' (standard closure stuff). When foo() is executed, > the anon sub is cloned, and at that time, $anon:x is s

Re: Will subroutine signatures apply to methods in Perl6

2001-08-21 Thread David L. Nicol
Garrett Goebel wrote: > > Any word from on high whether subroutine signatures will apply to methods in > Perl6? There's RFC128 and RFC97... but they both mostly dodge the issue of > methods. > > The absense of method signatures for specifying required, optional, and > named parameters... not to