Re: Transparent / Opaque references

2005-06-07 Thread TSa (Thomas Sandlaß)
Juerd wrote: $y() = 7; No, sorry, that looks to me as if $y is a reference to an lvalue sub, not like any form of referencing of scalars. I think it will come naturally to the C++ and Java folks. There the accessor kind of functions is either mapped into the name get_y() and set_y(value), or

Re: reduce metaoperator on an empty list

2005-06-07 Thread Larry Wall
Okay, I've made up my mind. The err option is not tenable because it can cloak real exceptions, and having multiple versions of reduce is simply multiplying entities without adding much power. So let's allow an optional identvalue trait on operators. If it's there, reduce can use it. If it's

return() in pointy blocks

2005-06-07 Thread Ingo Blechschmidt
Hi, sub foo (Code $code) { my $return_to_caller = - $ret { return $ret }; $code($return_to_caller); return 23; } sub bar (Code $return) { $return(42) } say foo bar; # 42 or 23? I think it should output 42, as the return() in the pointy block $return_to_caller

Re: return() in pointy blocks

2005-06-07 Thread Matt Fowles
Ingo~ On 6/7/05, Ingo Blechschmidt [EMAIL PROTECTED] wrote: Hi, sub foo (Code $code) { my $return_to_caller = - $ret { return $ret }; $code($return_to_caller); return 23; } sub bar (Code $return) { $return(42) } say foo bar; # 42 or 23? I think it should

Re: return() in pointy blocks

2005-06-07 Thread Piers Cawley
Ingo Blechschmidt [EMAIL PROTECTED] writes: Hi, sub foo (Code $code) { my $return_to_caller = - $ret { return $ret }; $code($return_to_caller); return 23; } sub bar (Code $return) { $return(42) } say foo bar; # 42 or 23? I think it should output

Re: return() in pointy blocks

2005-06-07 Thread Ingo Blechschmidt
Hi, Matt Fowles wrote: On 6/7/05, Ingo Blechschmidt [EMAIL PROTECTED] wrote: sub foo (Code $code) { my $return_to_caller = - $ret { return $ret }; $code($return_to_caller); return 23; } sub bar (Code $return) { $return(42) } say foo bar; # 42 or 23? I think it

Re: return() in pointy blocks

2005-06-07 Thread Luke Palmer
On 6/7/05, Matt Fowles [EMAIL PROTECTED] wrote: On 6/7/05, Ingo Blechschmidt [EMAIL PROTECTED] wrote: Hi, sub foo (Code $code) { my $return_to_caller = - $ret { return $ret }; $code($return_to_caller); return 23; } sub bar (Code $return) { $return(42) }

Re: return() in pointy blocks

2005-06-07 Thread Luke Palmer
On 6/7/05, Luke Palmer [EMAIL PROTECTED] wrote: Then let's put it this way: sub foo () { for 0..10 { when 6 { return 42 } } return 26; } And if that didn't do it, then let's write it equivalently as: sub foo () { map(- $_ { return 42

Re: return() in pointy blocks

2005-06-07 Thread Matt Fowles
All~ On 6/7/05, Luke Palmer [EMAIL PROTECTED] wrote: On 6/7/05, Matt Fowles [EMAIL PROTECTED] wrote: On 6/7/05, Ingo Blechschmidt [EMAIL PROTECTED] wrote: Hi, sub foo (Code $code) { my $return_to_caller = - $ret { return $ret }; $code($return_to_caller);

Re: reduce metaoperator on an empty list

2005-06-07 Thread Luke Palmer
On 6/7/05, Larry Wall [EMAIL PROTECTED] wrote: Okay, I've made up my mind. The err option is not tenable because it can cloak real exceptions, and having multiple versions of reduce is simply multiplying entities without adding much power. So let's allow an optional identvalue trait on

Re: reduce metaoperator on an empty list

2005-06-07 Thread Larry Wall
On Tue, Jun 07, 2005 at 09:41:49PM +, Luke Palmer wrote: : and still don't make sense as reduce operators. Yeah, I keep confusing them with min and max. : That reminds me, how are , , etc. defined anyway? How can we tell : them to be list-associative with each other? Because they're all

Re: reduce metaoperator on an empty list

2005-06-07 Thread Luke Palmer
On 6/7/05, Larry Wall [EMAIL PROTECTED] wrote: On Tue, Jun 07, 2005 at 09:41:49PM +, Luke Palmer wrote: : and still don't make sense as reduce operators. Yeah, I keep confusing them with min and max. : That reminds me, how are , , etc. defined anyway? How can we tell : them to be

Re: reduce metaoperator on an empty list

2005-06-07 Thread Sam Vilain
Luke Palmer wrote: and still don't make sense as reduce operators. Observe the table: # of args | Return (type) 0 | -Inf 1 | Num (the argument) 2 | bool ... | bool Let's look at the type of one of the many `reduce'

Re: reduce metaoperator on an empty list

2005-06-07 Thread Ph. Marek
On Tuesday 07 June 2005 23:41, Luke Palmer wrote: On 6/7/05, Larry Wall [EMAIL PROTECTED] wrote: Okay, I've made up my mind. The err option is not tenable because it can cloak real exceptions, and having multiple versions of reduce is simply multiplying entities without adding much power.