Re: [A-Z]+\s*\{

2002-01-21 Thread Ariel Scolnicov
Larry Wall <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] writes: [...] > : How does one enforce the no side-effects rule, and how deeply does it > : traverse? > > Dunno. Could warn or fail on assignment to any non-lexical or > non-local lexical as a start. Maybe we could warn or fail on

Re: A question

2002-01-21 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes: > Piers Cawley writes: > : Yeah, that's sort of where I got to as well. But I just wanted to make > : sure. I confess I'm somewhat wary of the ';' operator, especially > : where it's 'unguarded' by brackets, and once I start programming in > : Perl 6 then >

Re: A question

2002-01-21 Thread Piers Cawley
Piers Cawley <[EMAIL PROTECTED]> writes: > Larry Wall <[EMAIL PROTECTED]> writes: > >> Piers Cawley writes: >> : Yeah, that's sort of where I got to as well. But I just wanted to make >> : sure. I confess I'm somewhat wary of the ';' operator, especially >> : where it's 'unguarded' by brackets, a

Re: [A-Z]+\s*\{

2002-01-21 Thread Damian Conway
Larry wrote: > : One way to do that would be to define POST and NEXT to return their > : own (single, closure) argument. So then you could write: > : > : NEXT POST { ... } > > As long as everyone realizes that that return happens at compile > time... Sorry, yes, I should have been explic

Re: Apoc4: Parentheses

2002-01-21 Thread Bryan C. Warnock
On Sunday 20 January 2002 21:00, Damian Conway wrote: > Bryan C. Warnock asked: > > Since the parentheses are no longer required, will the expressions > > lose or retain their own scope level? (I'm assuming that whatever > > rule applies, it will hold true if you do elect to use parantheses > > a

Re: [A-Z]+\s*\{

2002-01-21 Thread Larry Wall
Larry Wall writes: : This is only slightly less problematic than : : NEXT $coderef; : : which in turn is only slightly less problematic than : : if $condition $coderef; Actually, that'd probably have to be: if $condition, $coderef; Still not sure if that has any possibility of ac

Re: Apoc4: Parentheses

2002-01-21 Thread Larry Wall
[EMAIL PROTECTED] writes: : On Sunday 20 January 2002 21:00, Damian Conway wrote: : > Bryan C. Warnock asked: : > > Since the parentheses are no longer required, will the expressions : > > lose or retain their own scope level? (I'm assuming that whatever : > > rule applies, it will hold true if y

Re: Apoc4: Parentheses

2002-01-21 Thread Damian Conway
> > Err. Expressions don't have their own scope level, even in Perl 5. > > They do in block conditional expressions. But that's a property of being in a block conditional, not of being an expression. And, yes, it's going away in Perl 6. Damian

Re: Apoc4: The loop keyword

2002-01-21 Thread Michael G Schwern
On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote: > : while( my $line = ) { > : ... > : } > > That still works fine--it's just that $line lives on after the while. This creeping lexical leakage bothers me. While it might make the language simpler, the proliferation of

RE: catching warnings

2002-01-21 Thread David Whipp
In light of Apo4, I thought I'd re-ask this question. Is the following still the approved idiom, or will we have a nice little /[A-Z]+/ thingie: sub foo { temp $SIG{__WARN__} = sub { warn "$(timestamp) $@\n" } warn "hello" } Dave. -- Dave Whipp, Senior Verification Engineer, Fast-Chip

Night of the Living Lexical (sequel to Apoc4: The loop keyword)

2002-01-21 Thread Melvin Smith
At 12:32 PM 1/21/2002 -0500, Michael G Schwern wrote: >On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote: > > : while( my $line = ) { > > : ... > > : } > > > > That still works fine--it's just that $line lives on after the while. > >This creeping lexical leakage bothers m

Re: Night of the Living Lexical (sequel to Apoc4: The loop keyword)

2002-01-21 Thread Michael G Schwern
On Mon, Jan 21, 2002 at 02:44:40PM -0500, Melvin Smith wrote: > At 12:32 PM 1/21/2002 -0500, Michael G Schwern wrote: > >On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote: > >> : while( my $line = ) { > >> : ... > >> : } > >> > >> That still works fine--it's just that $li

RE: Night of the Living Lexical (sequel to Apoc4: The loop keyword)

2002-01-21 Thread Tzadik Vanderhoof
Why all the fuss? Often, you would *want* to access that lexical after the loop terminates, for instance to check how it terminated. -Original Message- From: Michael G Schwern [mailto:[EMAIL PROTECTED]] Sent: Monday, January 21, 2002 2:59 PM To: Melvin Smith Cc: Larry Wall; Damian Conway

Re: Night of the Living Lexical (sequel to Apoc4: The loop keywor d)

2002-01-21 Thread Michael G Schwern
On Mon, Jan 21, 2002 at 03:02:06PM -0500, Tzadik Vanderhoof wrote: > Why all the fuss? Often, you would *want* to access that lexical after the > loop terminates, for instance to check how it terminated. In most cases you don't want that to happen, usually the life of the lexical is only the blo

RE: Night of the Living Lexical (sequel to Apoc4: The loop keywor d)

2002-01-21 Thread Melvin Smith
At 03:02 PM 1/21/2002 -0500, you wrote: >Why all the fuss? Often, you would *want* to access that lexical after the >loop terminates, for instance to check how it terminated. Why would you want to check it when the condition is typically boolean? while( my $line = ) { I think many pe

RE: Night of the Living Lexical (sequel to Apoc4: The loop keywor d)

2002-01-21 Thread Tzadik Vanderhoof
It's not the condition you would want to check, it's the variable (e.g. $line). -Original Message- From: Melvin Smith [mailto:[EMAIL PROTECTED]] Sent: Monday, January 21, 2002 3:15 PM To: Tzadik Vanderhoof Cc: [EMAIL PROTECTED] Subject: RE: Night of the Living Lexical (sequel to Apoc4: Th

RE: Night of the Living Lexical (sequel to Apoc4: The loop keywor d)

2002-01-21 Thread Melvin Smith
At 03:14 PM 1/21/2002 -0500, Melvin Smith wrote: >At 03:02 PM 1/21/2002 -0500, you wrote: >>Why all the fuss? Often, you would *want* to access that lexical after the >>loop terminates, for instance to check how it terminated. > >Why would you want to check it when the condition is typically bool

RE: Night of the Living Lexical (sequel to Apoc4: The loop keywor d)

2002-01-21 Thread Melvin Smith
At 03:16 PM 1/21/2002 -0500, Tzadik Vanderhoof wrote: >It's not the condition you would want to check, it's the variable (e.g. >$line). Right, I gotcha. I guess I would rather see it cater to the typical use, not the atypical. Of course my opinion of typical might differ from yours. I do feel th

Re: Apoc4: The loop keyword

2002-01-21 Thread Ted Ashton
Thus it was written in the epistle of Michael G Schwern, > On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote: > > : while( my $line = ) { > > : ... > > : } > > > > That still works fine--it's just that $line lives on after the while. > > This creeping lexical leakage bo

Re: Apoc4: The loop keyword

2002-01-21 Thread Casey West
On Mon, Jan 21, 2002 at 03:26:30PM -0500, Ted Ashton wrote: : :Thus it was written in the epistle of Michael G Schwern, :> On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote: :> > : while( my $line = ) { :> > : ... :> > : } :> > :> > That still works fine--it's just that

Re: Night of the Living Lexical (sequel to Apoc4: The loop keywor d)

2002-01-21 Thread Larry Wall
Melvin Smith writes: : At 03:16 PM 1/21/2002 -0500, Tzadik Vanderhoof wrote: : >It's not the condition you would want to check, it's the variable (e.g. : >$line). : : Right, I gotcha. I guess I would rather see it cater to the typical use, : not the atypical. Of course my opinion of typical might

Re: Apoc4: The loop keyword

2002-01-21 Thread Rafael Garcia-Suarez
On 2002.01.21 18:32 Michael G Schwern wrote: > On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote: > > : while( my $line = ) { > > : ... > > : } > > > > That still works fine--it's just that $line lives on after the while. > > This creeping lexical leakage bothers me. W

Re: Apoc4: The loop keyword

2002-01-21 Thread Damian Conway
Casey wrote: > So you're suggesting that we fake lexical scoping? That sounds more > icky than sticking to true lexical scoping. A block dictates scope, > not before and not after. I don't see ickyness about making that so. Exactly! What we're cleaning up is the ickiness of having things dec

RE: Apoc4: The loop keyword

2002-01-21 Thread David Whipp
Casey West wrote: > So you're suggesting that we fake lexical scoping? That sounds more > icky than sticking to true lexical scoping. A block dictates scope, > not before and not after. I don't see ickyness about making that so. Perl is well known for its non-orthogonality. To say that "A bloc

Re: Apoc4: The loop keyword

2002-01-21 Thread Larry Wall
Ted Ashton writes: : Thus it was written in the epistle of Michael G Schwern, : > On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote: : > > : while( my $line = ) { : > > : ... : > > : } : > > : > > That still works fine--it's just that $line lives on after the while. : >

Re: Apoc4: The loop keyword

2002-01-21 Thread Graham Barr
On Mon, Jan 21, 2002 at 12:50:38PM -0800, Larry Wall wrote: > : What's the chance that it could be considered so? > > In most other languages, you wouldn't even have the opportunity to put > a declaration into the conditional. You'd have to say something like: > > my $line = <$in>; >

Re: Apoc4: The loop keyword

2002-01-21 Thread Michael G Schwern
On Mon, Jan 21, 2002 at 03:27:29PM -0500, Casey West wrote: > So you're suggesting that we fake lexical scoping? That sounds more > icky than sticking to true lexical scoping. A block dictates scope, > not before and not after. I don't see ickyness about making that > so. Perl5 already fakes l

Re: Apoc4: The loop keyword

2002-01-21 Thread Larry Wall
David Whipp writes: : Casey West wrote: : > So you're suggesting that we fake lexical scoping? That sounds more : > icky than sticking to true lexical scoping. A block dictates scope, : > not before and not after. I don't see ickyness about making that so. : : Perl is well known for its non-or

Re: Apoc4: The loop keyword

2002-01-21 Thread Michael G Schwern
On Mon, Jan 21, 2002 at 03:43:07PM -0500, Damian Conway wrote: > Casey wrote: > > > So you're suggesting that we fake lexical scoping? That sounds more > > icky than sticking to true lexical scoping. A block dictates scope, > > not before and not after. I don't see ickyness about making that s

Re: Apoc4: The loop keyword

2002-01-21 Thread Melvin Smith
At 12:50 PM 1/21/2002 -0800, Larry Wall wrote: >In most other languages, you wouldn't even have the opportunity to put >a declaration into the conditional. You'd have to say something like: I grudgingly agree here. Where did this shorthand come from anyway? The first time I ever used it was C++

Re: Apoc4: The loop keyword

2002-01-21 Thread Larry Wall
Michael G Schwern writes: : On Mon, Jan 21, 2002 at 03:27:29PM -0500, Casey West wrote: : > So you're suggesting that we fake lexical scoping? That sounds more : > icky than sticking to true lexical scoping. A block dictates scope, : > not before and not after. I don't see ickyness about making

Re: Apoc4: The loop keyword

2002-01-21 Thread Graham Barr
On Mon, Jan 21, 2002 at 03:58:49PM -0500, Michael G Schwern wrote: > On Mon, Jan 21, 2002 at 03:43:07PM -0500, Damian Conway wrote: > > Casey wrote: > > > > > So you're suggesting that we fake lexical scoping? That sounds more > > > icky than sticking to true lexical scoping. A block dictates s

Re: Apoc4: The loop keyword

2002-01-21 Thread Larry Wall
Graham Barr writes: : But are we not at risk of introducing another form of : : my $x if 0; : : with : : if my $one = { : ... : } : elsif my $two = { : } : : if ($two) { : ... : } Then it's just undefined. It's no different from how &&, ||, or ??:: work when you put a

Re: Apoc4: The loop keyword

2002-01-21 Thread Graham Barr
On Mon, Jan 21, 2002 at 01:01:09PM -0800, Larry Wall wrote: > Graham Barr writes: > : But are we not at risk of introducing another form of > : > : my $x if 0; > : > : with > : > : if my $one = { > : ... > : } > : elsif my $two = { > : } > : > : if ($two) { > : ... > :

Re: Apoc4: The loop keyword

2002-01-21 Thread Larry Wall
Michael G Schwern writes: : In this case I'll take long-term simplicity over short-term : easy-to-explain rules. I fail to see what's simpler about it. : Otherwise we'll be writing this all over the : place til Kingdom come. : : do { : if my $foo = bar() { : ... :

RE: Apoc4: The loop keyword

2002-01-21 Thread David Whipp
Graham Barr wrote: > But I have lost count of the number > of times I have wanted to do > > if ((my $foo = bar()) eq 'foo') { > ... > } > > if ($foo eq 'bar') { > ... > } > To be contrasted with: while (my($k, $v) = each %h1) { ... } while (my($k, $v) = each %h2) # error? {

Re: Night of the Living Lexical (sequel to Apoc4: The loop keyword)

2002-01-21 Thread Uri Guttman
> "MS" == Melvin Smith <[EMAIL PROTECTED]> writes: MS> At 12:32 PM 1/21/2002 -0500, Michael G Schwern wrote: >> On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote: >> > : while( my $line = ) { >> > : ... >> > : } >> > >> > That still works fine--it's jus

Re: Night of the Living Lexical (sequel to Apoc4: The loop keyword)

2002-01-21 Thread Melvin Smith
At 04:12 PM 1/21/2002 -0500, Uri Guttman wrote: > MS> "lives on", ... "creeping lexical", I feel the same way, we must > find some > MS> way to kill these... :) > >well, larry looks at it differently and what he said on the cruise makes Well we had a go, but our kung fu powers were no match

Re: Apoc4: The loop keyword

2002-01-21 Thread Larry Wall
Graham Barr writes: : On Mon, Jan 21, 2002 at 01:01:09PM -0800, Larry Wall wrote: : > Graham Barr writes: : > : But are we not at risk of introducing another form of : > : : > : my $x if 0; : > : : > : with : > : : > : if my $one = { : > : ... : > : } : > : elsif my $two = { : > :

Re: Apoc4: The loop keyword

2002-01-21 Thread Glenn Linderman
Michael G Schwern wrote: > > In this case I'll take long-term simplicity over short-term > easy-to-explain rules. Otherwise we'll be writing this all over the > place til Kingdom come. > > do { > if my $foo = bar() { > ... > } > } I'm surprised no one else h

Re: [A-Z]+\s*\{

2002-01-21 Thread Bryan C. Warnock
On Monday 21 January 2002 11:14, Larry Wall wrote: > So I'm not terribly interested in going out of my way to make statement > blocks parse exactly like terms in an ordinary expressions. If it > happens, it'll probably be by accident. That's fine. (And I agree.) All I really cared about was ma

Re: Apoc4: Parentheses

2002-01-21 Thread Bryan C. Warnock
On Monday 21 January 2002 11:27, Larry Wall wrote: > Compound statements in Perl 5 do have an implicit {} around the entire > statement, but that has nothing to do with the required parentheses > around the expressions, other than the fact that we're doing away with > both of those special rules i

Re: Apoc4: The loop keyword

2002-01-21 Thread Graham Barr
On Mon, Jan 21, 2002 at 01:38:39PM -0800, Larry Wall wrote: > Graham Barr writes: > : On Mon, Jan 21, 2002 at 01:01:09PM -0800, Larry Wall wrote: > : > Graham Barr writes: > : > : But are we not at risk of introducing another form of > : > : > : > : my $x if 0; > : > : > : > : with > : > : >

Re: tainting nums (was Re: the handiness of undef becoming NaN (when you want that))

2002-01-21 Thread Larry Wall
Nicholas Clark writes: : On Fri, Nov 09, 2001 at 09:14:10AM -0800, Larry Wall wrote: : > NaN is merely the floating-point representation of undef when your : > variable is stored in a bare num. And if you declare a variable as : > int, there may well be no representation for undef at all! Simila

Re: [dha@panix.com: Re: ^=~]

2002-01-21 Thread Damian Conway
> Hmm. A hyperdwim operator. So that means that > > @result = @a ^=~ @b > > is the same as > > @result = map -> $a; $b { $a =~ $b } (@a; @b) > > Or something resembling that that actually works... > > Hmm. I suppose it could be argued that a C in list context: > > @result = fo

RE: Apoc4: The loop keyword

2002-01-21 Thread Michael Percy
Graham Barr wrote: > On Mon, Jan 21, 2002 at 03:58:49PM -0500, Michael G Schwern wrote: Case 1: > > do { > > if my $foo = bar() { > > ... > > } > > } Case 2: > if ((my $foo = bar()) eq 'foo') { > ... > } > > if ($foo eq 'bar') { > ... > } Des

Some Apocalypse 4 exception handling questions.

2002-01-21 Thread Tony Olekshy
In Apocalypse 4, Larry Wall wrote: | | In fact, a C of the form: | | CATCH { | when xxx { ... } # 1st case | when yyy { ... } # 2nd case | ... # other cases, maybe a default | } | |means something vaguely like: