Re: where without type?

2005-01-29 Thread =?ISO-8859-1?Q?Carl_M=E4sak?=
On Fri, 28 Jan 2005 11:38:51 -0700, Luke Palmer [EMAIL PROTECTED] wrote: I don't think it's the cleanest solution, but it works. Just out of curiosity, what do you think would be a cleaner solution? And why would one not want to implement such a solution instead? // Carl On Fri, 28 Jan 2005

Re: where without type?

2005-01-29 Thread Luke Palmer
Carl Msak writes: On Fri, 28 Jan 2005 11:38:51 -0700, Luke Palmer [EMAIL PROTECTED] wrote: I don't think it's the cleanest solution, but it works. Just out of curiosity, what do you think would be a cleaner solution? And why would one not want to implement such a solution instead? I

where without type?

2005-01-28 Thread Juerd
Consider: my $foo of Num where { 0 = $^n 10 }; Is the following also valid? my $foo where { 0 = $^n 10 }; Or does that have to be like this? my $foo of Scalar where { 0 = $^n 10 }; And can $_ be used instead of $^n? Juerd

Re: where without type?

2005-01-28 Thread Luke Palmer
Juerd writes: Consider: my $foo of Num where { 0 = $^n 10 }; Is the following also valid? my $foo where { 0 = $^n 10 }; I don't see why not. The main place Cwhere will be useful is in multimethods, and I see that as a reasonable shorthand: multi sub foo(Bar $x, $y where

Re: where without type?

2005-01-28 Thread Juerd
Luke Palmer skribis 2005-01-28 9:31 (-0700): And can $_ be used instead of $^n? Of course it can. You know that. I do? Can't say I understand well when a topic is implicitly defined and when not. It's obvious for for-loops and given, but everything else is blurry to me. Juerd

Re: where without type?

2005-01-28 Thread Luke Palmer
Juerd writes: Luke Palmer skribis 2005-01-28 9:31 (-0700): And can $_ be used instead of $^n? Of course it can. You know that. I do? Can't say I understand well when a topic is implicitly defined and when not. It's obvious for for-loops and given, but everything else is blurry to