On Wed, Feb 27, 2002 at 04:24:48PM -0600, Garrett Goebel wrote:
> From: Allison Randal
>
> Not just some value external to the switch, but the value in $_.
>
> I now see the DWIM aspect. Thanks BTW.
>
> But how often will people have non- C statements within a C
> scope that'll need the special
Dang... why isn't you see so many more obvious errors, the moment after you
click send?
From: Garrett Goebel [mailto:[EMAIL PROTECTED]]
>
> or without the special case:
>
> $hi = 'hello';
> $x = 'burt';
> for $hi -> $y {
> given {
> when /burt/ { print "Go Away" };
default { print
From: Allison Randal
> Garrett Goebel wrote:
> >
> > Why does C's EXPR pay attention to the topicalizer
> > regardless of associated variable?
> >
> > Why introduce the special case?
>
> Why? Because it's oh-so dwim. Think about it, if you've just typed a
>
> given $x { ...
> or
>
From: Brent Dax [mailto:[EMAIL PROTECTED]]
> Garrett Goebel:
> # Larry Wall in Apocalypse 4 writes:
> # > this special rule only applies to constructs that take a
> # > block (that is, a closure) as their last (or only) argument.
> # > Operators like sort and map are unaffected. However, certain
>
On Wed, Feb 27, 2002 at 10:11:13AM -0800, Austin Hastings wrote:
>
> > C is a conditional like C, not a topicalizer.
>
> Right, it's a topicalizee, the victim of topicalization. And so it uses
> $_ or $x or $! or whatever the current topic is.
i.e. a "defaulting construct" or "topic sensitive k
Garrett Goebel:
# Larry Wall in Apocalypse 4 writes:
# > this special rule only applies to constructs that take a
# > block (that is, a closure) as their last (or only) argument.
# > Operators like sort and map are unaffected. However, certain
# > constructs that used to be in the statement class
--- Allison Randal <[EMAIL PROTECTED]> wrote:
> I'm still not convinced of your basic point, that it would be a good
> thing to have C aliasing $_. Variations on whether it does it
> automatically or at my request and how don't change the fundamental
> concept. C is a conditional like C, not a to
On Wed, Feb 27, 2002 at 10:32:24AM -0600, Garrett Goebel wrote:
>
> Why does C's EXPR pay attention to the topicalizer regardless of
> associated variable?
>
> Why introduce the special case? Especially when consistency and
> simplification seem to be a strong undercurrent in Perl6? I'm curious
--- Garrett Goebel <[EMAIL PROTECTED]> wrote:
> Speaking of which, you forgot your trailing semicolon
> for the C expression's final closure/block.
I'll claim that when, like if, shouldn't need one. (I'd also normally
use multiple lines, but I'm trying to conserve newlines... :-)
> Why does C'
On Wed, Feb 27, 2002 at 08:02:08AM -0800, Austin Hastings wrote:
>
> BTW, C doesn't alias $_ always. That's why things like the example
> below are possible.
Yes. C and C will only alias $_ when they are not aliasing a
named variable.
> Hmm. Suppose we force C to alias $_, but give the coder o
--- Austin Hastings <[EMAIL PROTECTED]> wrote:
> --- Garrett Goebel <[EMAIL PROTECTED]> wrote:
> > Larry Wall wrote:
> > > I think the switch statement will have to recognize any
> > > Class::Name known at compile time, and force it to call
> > > $!.isa(Class::Name).
> >
> > Don't you mean the c
--- Garrett Goebel <[EMAIL PROTECTED]> wrote:
> Larry Wall wrote:
> > I think the switch statement will have to recognize any
> > Class::Name known at compile time, and force it to call
> > $!.isa(Class::Name).
>
> Don't you mean the case/when statement? Wouldn't you want the
> following to
> wor
From: Garrett Goebel [mailto:[EMAIL PROTECTED]]
> Speaking of which, you forgot your trailing semicolon for the
> C expression's final closure/block.
s/expression/statement/
Larry Wall in Apocalypse 4 writes:
> this special rule only applies to constructs that take a
> block (that is, a closure) as their last (or only) argument.
> Operators like sort and map are unaffected. However, certain
> constructs that used to be in the statement class may become
> expression co
--- Larry Wall <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] writes:
> : More questions on downwards binding,
> :
> : > for @foo -> $a, $b { # two at a time
> : > ...
> : > }
> :
> : Interpretation #1:
> : for @foo[0..$foo:2] -> $a,
> : @foo[1..$foo:2] -> $b
> : { ... }
>
Larry Wall wrote:
> I think the switch statement will have to recognize any
> Class::Name known at compile time, and force it to call
> $!.isa(Class::Name).
Don't you mean the case/when statement? Wouldn't you want the following to
work:
for @obj {
when Dog { ... }
when Cat { ... }
}
From: Austin Hastings [mailto:[EMAIL PROTECTED]]
>
> for @A {
> for @B -> $x {
> when /a/ $_ -> $a { s/a/b/; ... $a ...; }
> }
> }
>
> Once we get inside the curlies, $_ is aliased to the localized var for
> the C (in this case, $x).
I went back and read the Apocolypse 4: RFC 022. I may
It's amazing what a night will do. See bottom.
--- Allison Randal <[EMAIL PROTECTED]> wrote:
> On Tue, Feb 26, 2002 at 02:20:48PM -0800, Brent Dax wrote:
> > Austin Hastings:
> > #
> > # Which, then, would you like:
> > #
> > # To implicitly localize $_, losing access to an outer version,
> > # o
18 matches
Mail list logo