Re: proposal: when-blocks, and binding $_

2002-02-28 Thread Austin Hastings
--- Allison Randal [EMAIL PROTECTED] wrote: On Wed, Feb 27, 2002 at 10:11:13AM -0800, Austin Hastings wrote: Cwhen is a conditional like Cif, 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.

Re: proposal: when-blocks, and binding $_

2002-02-28 Thread Allison Randal
On Thu, Feb 28, 2002 at 04:12:12PM -0800, Austin Hastings wrote: Nobody has the least bit of trouble understanding that WITHIN the for loop, the default value just changed from whatever it was outside Well, Cfor is a topicalizer, and always has been, even before we had a name for it, so this

Re: proposal: when-blocks, and binding $_

2002-02-27 Thread Austin Hastings
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, # or to have to

Re: proposal: when-blocks, and binding $_

2002-02-27 Thread Allison Randal
On Wed, Feb 27, 2002 at 08:02:08AM -0800, Austin Hastings wrote: BTW, Cfor doesn't alias $_ always. That's why things like the example below are possible. Yes. Cfor and Cgiven will only alias $_ when they are not aliasing a named variable. Hmm. Suppose we force Cwhen to alias $_, but give

Re: proposal: when-blocks, and binding $_

2002-02-27 Thread Austin Hastings
--- Allison Randal [EMAIL PROTECTED] wrote: I'm still not convinced of your basic point, that it would be a good thing to have Cwhen aliasing $_. Variations on whether it does it automatically or at my request and how don't change the fundamental concept. Cwhen is a conditional like Cif, not

Re: proposal: when-blocks, and binding $_

2002-02-27 Thread Allison Randal
On Wed, Feb 27, 2002 at 10:11:13AM -0800, Austin Hastings wrote: Cwhen is a conditional like Cif, 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

proposal: when-blocks, and binding $_

2002-02-26 Thread Austin Hastings
The when keyword can use a localizer that makes its target obvious but slightly counter-intuitive. given $x { when /a/ { ... } } The problem is operations within the when-block that might expect to use $_, the defaultdefault variable. given $x { when /a/ { s/a/A/; } } After all, I used a

Re: proposal: when-blocks, and binding $_

2002-02-26 Thread Allison Randal
On Tue, Feb 26, 2002 at 01:26:41PM -0800, Austin Hastings wrote: Possibility B- when-blocks accept a - operator, which if used naked binds the current localizer to $_. I think if I had a choice between given $y - $x { when /a/ - {...} when /b/ - {...} ... } and

RE: proposal: when-blocks, and binding $_

2002-02-26 Thread Brent Dax
Austin Hastings: # --- Allison Randal [EMAIL PROTECTED] wrote: # On Tue, Feb 26, 2002 at 01:26:41PM -0800, Austin Hastings wrote: # # Possibility B- when-blocks accept a - operator, which if used # naked # binds the current localizer to $_. # # I think if I had a choice between # #

Re: proposal: when-blocks, and binding $_

2002-02-26 Thread Allison Randal
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, # or to have to change between implicit and explicit operations? Well, I like the idea of having Cwhen and the