Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-22 Thread Dan Sugalski
At 10:48 AM 2/22/2001 +0100, Bart Lateur wrote: >On Wed, 21 Feb 2001 17:32:50 -0500 (EST), Sam Tregar wrote: > > >On Wed, 21 Feb 2001, Bart Lateur wrote: > > > >> Actually, it's pretty common. Only, most languages are not as forgiving > >> as perl, and what is merely a warning in Perl, is a fatal

RE: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-22 Thread Paul Marquess
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] ... > > The basic usefulness of warnings is not in question. This is about > the *perception* of their utility. Warnings are only useful if the > user heeds them. The question is, will having them on by default make > the user more or less l

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-22 Thread Peter Scott
At 09:36 AM 2/22/2001 +, David Grove wrote: >This is what's scaring me about all this talk about >exceptions... it can break this mold and make Perl into a "complainer >language" belching up uncaught (don't care) exceptions forcing try/except >blocks around every piece of IO or DB handling. Th

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-22 Thread David Grove
Bart Lateur <[EMAIL PROTECTED]> wrote: > On Wed, 21 Feb 2001 17:32:50 -0500 (EST), Sam Tregar wrote: > > >On Wed, 21 Feb 2001, Bart Lateur wrote: > > > >> Actually, it's pretty common. Only, most languages are not as forgiving > >> as perl, and what is merely a warning in Perl, is a fatal

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-22 Thread John Porter
Sam Tregar wrote: > [EMAIL PROTECTED] wrote: > > Well, an unhandled exception in Java is death for the program. > > Yup. So all (potentially) exceptions are "fatal errors"? Well, that > definition fits "almost meaningless" pretty well, in my opinion! Not exactly. Java defines two clases of "t

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-22 Thread Bart Lateur
On Wed, 21 Feb 2001 17:32:50 -0500 (EST), Sam Tregar wrote: >On Wed, 21 Feb 2001, Bart Lateur wrote: > >> Actually, it's pretty common. Only, most languages are not as forgiving >> as perl, and what is merely a warning in Perl, is a fatal error in those >> languages. >Examples? I know you're no

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-22 Thread Bart Lateur
On Wed, 21 Feb 2001 16:01:39 -0500, [EMAIL PROTECTED] wrote: >Has anyone actually used a language which has run-time warnings on by >default? Or even know of one? Actually, it's pretty common. Only, most languages are not as forgiving as perl, and what is merely a warning in Perl, is a fatal er

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-22 Thread schwern
On Wed, Feb 21, 2001 at 06:05:25PM -0800, Peter Scott wrote: > Are we still having this discussion? :-) *sigh* yes. > I do not think there is hard dividing line between warnings and > errors. "Unable to establish network connection - saving file to local > disk" means the program is still ru

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-21 Thread schwern
On Wed, Feb 21, 2001 at 05:32:50PM -0500, Sam Tregar wrote: > Examples? I know you're not talking about C or C++. I'm pretty sure > you're not talking about Java - exception-handling renders the term "fatal > error" almost meaningless. Well, an unhandled exception in Java is death for the progr

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-21 Thread schwern
Its true alot languages would consider many of Perl's warnings to be errors, that's not really analgous to what we're talking about here. Run-time errors aren't quite in the same spirit as run-time warnings. A run-time error is something the language defines as being explicitly bad or a mistake (

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-21 Thread Peter Scott
Are we still having this discussion? :-) At 07:23 PM 2/21/01 -0500, [EMAIL PROTECTED] wrote: >Its true alot languages would consider many of Perl's warnings to be >errors, that's not really analgous to what we're talking about here. > >Run-time errors aren't quite in the same spirit as run-time w

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-21 Thread schwern
Has anyone actually used a language which has run-time warnings on by default? Or even know of one? -- Michael G Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/ Perl6 Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-20 Thread Edward Peschko
> This isn't an addition to the language that you're talking about - it's > changing some of the fundamental behavior of the language. It's saying > that no longer is Perl a loose, powerful language - oh, you want B&D? well, > we can do that for you too - but rather that Perl is just another

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-20 Thread Bryan C . Warnock
On Tuesday 20 February 2001 22:03, Edward Peschko wrote: > > I *like* the interpretation of undef as 0 and "". It's useful. Sometimes. > > Sometimes it's not. And that's fine. > > No that's NOT fine. It leads to 'find the needle in the haystack' sort of > problems. If you get 1450 'use of

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-20 Thread Edward Peschko
On Tue, Feb 20, 2001 at 08:33:50PM -0500, Bryan C. Warnock wrote: > On Tuesday 20 February 2001 19:34, Edward Peschko wrote: > > > Well, for one, your example is ill-considered. You are going to get > > autovivification saying: > > The two ideas were disjoint. The example wasn't an example of

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-20 Thread John Porter
What it boils down to is, warnings are for perl to tell you when you probably made a logic error, based on the perl code it sees. What some people might think is merely unperlish code, others might say is "horribly wrong". -- John Porter

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-20 Thread Bart Lateur
On Tue, 20 Feb 2001 16:31:35 -0500, Bryan C. Warnock wrote: >Scalar value @foo[$bar] better written as $foo[$bar], for one. I agree on this one (hash slices too), if this expression is in list context. There is no error in @r = map { blah } @foo{$bar}; -- Bart.

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-20 Thread Bryan C . Warnock
On Tuesday 20 February 2001 16:03, John Porter wrote: > Bryan C. Warnock wrote: > > > > And there's a difference between warnings originating because something has > > gone wrong and those originating because I'm doing something particularly > > perlish. Unfortunately, -w doesn't (and probab

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-20 Thread John Porter
Bryan C. Warnock wrote: > > And there's a difference between warnings originating because something has > gone wrong and those originating because I'm doing something particularly > perlish. Unfortunately, -w doesn't (and probably can't) tell the > difference. Can you give me an example of t

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-20 Thread Bryan C . Warnock
On Tuesday 20 February 2001 14:45, Stephen P. Potter wrote: > Lightning flashed, thunder crashed and John Porter <[EMAIL PROTECTED]> whispered > : > | Yep; the perl manpage has said, since time immemorial, that > | the fact that -w was not on by default is a BUG. > > I don't know that I would s

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-20 Thread Stephen P. Potter
Lightning flashed, thunder crashed and John Porter <[EMAIL PROTECTED]> whispered : | Yep; the perl manpage has said, since time immemorial, that | the fact that -w was not on by default is a BUG. I don't know that I would say time immemorial. It wasn't in the man for 4.036. I can only find man

Re: Closures and default lexical-scope for subs

2001-02-20 Thread Peter Scott
At 05:27 PM 2/19/01 +, Piers Cawley wrote: >Peter Scott <[EMAIL PROTECTED]> writes: > > I don't want to DWIM this. Would it be so bad to have to type > > > > GetOptions (foo => \my ($foo), > > bar => \my $bar); > >If you're really all for maintainability, then surely you

Re: Closures and default lexical-scope for subs

2001-02-19 Thread Piers Cawley
Peter Scott <[EMAIL PROTECTED]> writes: > At 09:01 PM 2/15/01 +0100, [EMAIL PROTECTED] wrote: > >On Thu, Feb 15, 2001 at 11:08:47AM -0800, Edward Peschko wrote: > > > However, that still doesn't get rid of the gotchas - personally I think that: > > > > > > > my $a, $b, $c; > > > > > > should be

Re: The binding of "my" (Re: Closures and default lexical-scope for subs)

2001-02-17 Thread John Porter
Johan Vromans wrote: > > If a Perl construct does not suffer from a slight change that makes > it easier to accept by new programmers, I think such changes should > be seriously considered. Yes; but the world if full of language [sorry, couldn't resist] which is optimized (or at least meant to b

Re: The binding of "my" (Re: Closures and default lexical-scope for subs)

2001-02-17 Thread Johan Vromans
John Porter <[EMAIL PROTECTED]> writes: > As someone else said before me, Perl should not be changed > Just Because We Can. Aspects which have proven usefulness and > are deeply engrained in the Perl mindset should not be tampered > with just because some recent convert finds them un-Algol-like

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-16 Thread John Porter
> Why with `my' I do need them? Why don't these behave the same? Because the precedence is different. Remember, 'my' is a lexical construct. It does not "return" a value, and it does not take "arguments" -- not in the runtime sense. It applies only to literal variable symbols. It is meaningless (

Re: The binding of "my" (Re: Closures and default lexical-scope for subs)

2001-02-16 Thread John Porter
Simon Cozens wrote: > John Porter wrote: > > But they are inextricably bound by perl's parsing rules. > > Perl 5's parsing rules. I don't think Perl 6 *has* a parser just yet. As someone else said before me, Perl should not be changed Just Because We Can. Aspects which have proven usefulness a

Re: The binding of "my" (Re: Closures and default lexical-scope for subs)

2001-02-16 Thread John Porter
This just isn't making sense. Currently one has to write my( $x, $y, $z ) = @_; And you're willing to eviscerate perl to save two keystrokes; you say you'd be happy with either my $x, $y, $z = @_; or ( $x, $y, $z ) = @_; but the (consequent) fact that $x, $y,

Re: The binding of "my" (Re: Closures and default lexical-scope for subs)

2001-02-16 Thread Simon Cozens
On Fri, Feb 16, 2001 at 03:45:21PM -0500, John Porter wrote: > But they are inextricably bound by perl's parsing rules. Perl 5's parsing rules. I don't think Perl 6 *has* a parser just yet. > You can't keep Perl6 Perl5. See? -- What happens if a big asteroid hits the Earth? Judging from real

Re: The binding of "my" (Re: Closures and default lexical-scope for subs)

2001-02-16 Thread John Porter
Nathan Wiger wrote: > To rehash, all this discussion should involve is the possibility of > making "my" swallow its list args: >my $x, $y, $z; # same as my($x, $y, $z) > That's it. No changing the way lists and , and = work in Perl. But they are inextricably bound by perl's parsing rules.

Re: Closures and default lexical-scope for subs

2001-02-16 Thread John Porter
Branden wrote: > a) Many of us want Perl to have globals as default, what is opposed to > some that want `use strict' and `-w' turned on by default. You are profoundly confused. Globals *are* the default in current perl; and having strict 'vars' on does not magically change that. strict 'subs',

Re: The binding of "my" (Re: Closures and default lexical-scope for subs)

2001-02-16 Thread Branden
Nathan Wiger wrote: > > I wouldn't be so hasty to withdraw from the my binding argument. There's > many uses of "my" that are required even with the "use scope" pragma (at > least as I described it in RFC 64, but feel free to point it out if I > missed an application). I think there's some good ch

Re: The binding of "my" (Re: Closures and default lexical-scope for subs)

2001-02-16 Thread Jarkko Hietaniemi
>FOR >--- > 1. It becomes more consistent with other Perl functions my is not a function. It is a declaration. Functions take arguments and return values. my does not. It is language construct like if. Unless, of course, you claim that if is a function, too. That ways lies LISP.

The binding of "my" (Re: Closures and default lexical-scope for subs)

2001-02-16 Thread Nathan Wiger
Branden wrote: > > As to the second item b), I would say I withdraw my complaints about `my' if > my other proposal of `use scope' gets approved (since then I don't need `my' > anymore!). I guess I would be happier with `use scope', and I also think it > would make you happier, since it wouldn't

Re: Closures and default lexical-scope for subs

2001-02-16 Thread Branden
Well, I'll try to reach to an agreement here, since this discussion is getting pretty much pointless. What do we know: a) Many of us want Perl to have globals as default, what is opposed to some that want `use strict' and `-w' turned on by default. b) Some of us (that would be me, I think) think

Re: Closures and default lexical-scope for subs

2001-02-16 Thread Branden
John Porter wrote: > > Well, for me, it isn't useful, unless you can show me I'm wrong. At least > > give me an example that shows it's more useful this way. > > First, we must always remember that whatever we do, we can > force explicit precedence through the addition of parentheses. > The cases

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-16 Thread Peter Scott
At 09:56 AM 2/16/2001 -0500, John Porter wrote: > > As for the -q thing, I think it is far *less* of a burden to add "use > > strict" and "use warnings" when you're writing a big piece of code. When > > you're writing 5 lines, every extra character counts. When you're > > writing 500 or 5000 lines

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-16 Thread Branden
John Porter wrote: > > Having `my' with the same precedence rules as `print' for example, > > 'my' is not 'print', it is not like 'print', is not comparable > to 'print'. Please stop with the bogus comparisons. > Agree they're different (one is compile-time, other runtime, and much more differe

Re: Closures and default lexical-scope for subs

2001-02-16 Thread John Porter
Simon Cozens wrote: > > John, settle down. None of us profess to be fantastic language designers, > which is why we gave Larry the job. That being done, I'm not entirely sure why > people are continuing to argue about these things. :) You're right, of course. I should have faith that Larry will

Re: Closures and default lexical-scope for subs

2001-02-16 Thread Simon Cozens
On Fri, Feb 16, 2001 at 10:26:40AM -0500, John Porter wrote: > Oh, that's a terrific improvement. > Basically you want to change (= break) the current precedence > of the comma operator. Thank you, Mr. Language Designer. John, settle down. None of us profess to be fantastic language designers, w

Re: Closures and default lexical-scope for subs

2001-02-16 Thread Jonathan Scott Duff
On Fri, Feb 16, 2001 at 01:20:43PM -0300, Branden wrote: > `my' DWIMs. `my' will do what *you* mean at the cost of every single existing perl programmer that currently uses it to relearn what it means. Not a good trade off IMHO. I'd rather `my' does what *I* mean which is what it does now. > I

Re: Closures and default lexical-scope for subs

2001-02-16 Thread Branden
John Porter wrote: > It turns > out that 'my' having higher precedence than comma is signficantly > more useful than if it had a lower precedence. > Well, for me, it isn't useful, unless you can show me I'm wrong. At least give me an example that shows it's more useful this way. > Let's all just

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-16 Thread Bryan C . Warnock
On Friday 16 February 2001 11:38, Branden wrote: > > (my($a),our($b),local($,),my($c)) = @_; > > What is it, anyway? A joke? (There's Perl poetry, why can't be there Perl > jokes?) Who writes this kind of code anyway? Okay, you caught me, it was a contrived exampled. The actual code was

Re: Closures and default lexical-scope for subs

2001-02-16 Thread Bryan C . Warnock
On Friday 16 February 2001 11:20, Branden wrote: > proposal. I don't think it works, because > > $a, $b, $c = @_;# $c gets 10 for @_=(1..10) > > mean a different thing that > > my $a, $b, $c = @_; # $c gets 3 for @_=(1..10) It does? > > The last code should behave as >

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-16 Thread Branden
John Porter wrote: > Come on. What's so hard about knowing > ( $x, $y, $z ) > is a bunch of variables, and > my( $x, $y, $z ) > is a bunch of variables declared local. > Answer: nothing. > If you see some code saying my $a, $b, $c; Would you say $b and $c are subject to a different scoping

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-16 Thread John Porter
Edward Peschko wrote: > NOTE: to perl5 users - by default, perl is doing more up-front error checking. > To get the old behavior, you can say 'perl -q' in front of your scripts, Yep; the perl manpage has said, since time immemorial, that the fact that -w was not on by default is a BUG. So chan

Re: Closures and default lexical-scope for subs

2001-02-16 Thread John Porter
Branden wrote: > Anyway, I don't see why `local' (and `our' and `my') should bind more > strongly than , and = . They are list operators, they should behave > the same as those. "In general, perl does what you want -- unless what you want is consistency." The point is that consistency is NOT the

Re: Closures and default lexical-scope for subs

2001-02-16 Thread John Porter
Edward Peschko wrote: > well, for the small fraction of people that use it, they probably are > experienced and know to use parens to disambiguate. No, *everyone* knows to use parens to disambiguate. > And anyways: > my $a, $b, $c = @_; > not working is 'very hard to bugtrack and totally une

Re: Closures and default lexical-scope for subs

2001-02-16 Thread Branden
Bryan C. Warnock wrote: > Oh, wait, commas are now implicitly parenthesized, so that > (my $a, $b, $c) = @_; > can be written as > my $a, $b, $c = @_; > Oh! I never said commas are implicitly parenthesized! That was other proposal. I don't think it works, because $a, $b, $c = @_;# $

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-16 Thread John Porter
Nathan Wiger wrote: > Let alone that this: >my $x, $y, $z; > Doesn't DWIM, again according to what most people think. Come on. What's so hard about knowing ( $x, $y, $z ) is a bunch of variables, and my( $x, $y, $z ) is a bunch of variables declared local. Answer: nothing.

Re: Closures and default lexical-scope for subs

2001-02-16 Thread Bryan C . Warnock
On Friday 16 February 2001 09:24, Branden wrote: > I said: > > Anyway, I don't see why `local' (and `our' and `my') should bind more > > strongly than , and = . Because the implicit global scope declarator binds that tightly. Because you lose the ability to mix scope declarators in an assigment.

Re: Closures and default lexical-scope for subs

2001-02-16 Thread Branden
I said: > Anyway, I don't see why `local' (and `our' and `my') should bind more > strongly than , and = . They are list operators, they should behave the same > as those. > Actually, they *look like* list operators, they should behave like those. > - Branden > >

Re: Closures and default lexical-scope for subs

2001-02-16 Thread Branden
Bryan C. Warnock wrote: > On Friday 16 February 2001 07:36, Branden wrote: > > But it surely isn't > > consistent with the rest of the language. > > It's consistent with "our" and "local", which are really the only other > things in the language that parallel its use. > Well, `local' is actually

Re: Closures and default lexical-scope for subs

2001-02-16 Thread Branden
<[EMAIL PROTECTED]> wrote: > > tie (my $shoe) => $string; > > Not enough arguments for tie... > tie +(my $shoe) => $string; This is the same as would happen to `print', for example. Or else, the easyer tie my($shoe) => $string; It doesn't look like a function, so it isn't. > > Ah, mo

Re: Closures and default lexical-scope for subs

2001-02-16 Thread Branden
Edward Peschko wrote: > How about 'an implicit parens around a set of statements separated by commas > in any context'? This is consistent > > $a, $b, $c = $d, $e, $f; # ($a, $b, $c) = ($d, $e, $f); > I guess this should be $a, $b, ($c = $d), $e, $f I think making `my' work just the same as

Re: Closures and default lexical-scope for subs

2001-02-16 Thread Branden
<[EMAIL PROTECTED]> wrote: > @a = (1 .. 10); > $a, $b, $c = @_; > > $c becomes 10. Should $c become 3 when my is placed before $a? > No. If my binds weaker than =, it would be my $a, $b, $c = @_; is the same as my $a, $b, ($c = @_); as the opposite of (my $a, $b, $c) =

Re: Closures and default lexical-scope for subs

2001-02-16 Thread Bryan C . Warnock
On Friday 16 February 2001 07:36, Branden wrote: > But it surely isn't > consistent with the rest of the language. It's consistent with "our" and "local", which are really the only other things in the language that parallel its use. -- Bryan C. Warnock bwarnock@(gtemail.net|capita.com)

Re: Closures and default lexical-scope for subs

2001-02-16 Thread Branden
<[EMAIL PROTECTED]> wrote: > As I wrote elsewhere, other reasons not to change the behaviour of my: > > GetOptions (foo => \my $foo, > bar => \my $bar); > GetOptions (foo => \my($foo), bar => \my($bar)); > tie my $shoe => $tring; > tie my($shoe) => $tring; #

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-15 Thread Edward Peschko
I guess this was what was meant by 'put your asbestos gloves on'. On Thu, Feb 15, 2001 at 07:57:31PM -0500, Bryan C. Warnock wrote: > On Thursday 15 February 2001 19:21, Edward Peschko wrote: > > How many times have I wanted to put 'use strict' in a module and > forgotten > > about it? > > T

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Edward Peschko
On Fri, Feb 16, 2001 at 12:32:01AM +0100, [EMAIL PROTECTED] wrote: > On Thu, Feb 15, 2001 at 03:07:51PM -0800, Edward Peschko wrote: > > > > > Also, if I have: > > > > > > @a = (1 .. 10); > > > $a, $b, $c = @_; > > > > How about 'an implicit parens around a set of statements separated b

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-15 Thread Bryan C . Warnock
On Thursday 15 February 2001 19:21, Edward Peschko wrote: > How many times have I wanted to put 'use strict' in a module and forgotten > about it? Then it isn't, technically, a perl problem. > How many times have I wanted to use '-w' but was not able to because > of all the junk that comes ou

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-15 Thread Edward Peschko
On Thu, Feb 15, 2001 at 02:54:37PM -0800, Nathan Wiger wrote: > Edward Peschko wrote: > > Right, but what I don't understand is that its two extra characters at the end > > of a command line... whats the big deal about typing '-q' on one line in > > scripts? Its easy enough to advertise '-q' and

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Nicholas Clark
On Thu, Feb 15, 2001 at 10:29:33PM +0100, [EMAIL PROTECTED] wrote: > On Thu, Feb 15, 2001 at 08:19:27PM +, Nicholas Clark wrote: > > On Thu, Feb 15, 2001 at 09:05:55PM +0100, [EMAIL PROTECTED] wrote: > > > On Thu, Feb 15, 2001 at 11:23:10AM -0800, Nathan Wiger wrote: > > > > But I have never f

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Peter Scott
At 09:01 PM 2/15/01 +0100, [EMAIL PROTECTED] wrote: >On Thu, Feb 15, 2001 at 11:08:47AM -0800, Edward Peschko wrote: > > However, that still doesn't get rid of the gotchas - personally I think > that: > > > > my $a, $b, $c; > > > > should be an error, a warning, or DWIM. Especially: > >Personally

Re: Closures and default lexical-scope for subs

2001-02-15 Thread abigail
On Thu, Feb 15, 2001 at 03:07:51PM -0800, Edward Peschko wrote: > > > Also, if I have: > > > > @a = (1 .. 10); > > $a, $b, $c = @_; > > How about 'an implicit parens around a set of statements separated by commas > in any context'? This is consistent > > $a, $b, $c = $d, $e, $f; # ($a,

Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-15 Thread schwern
On Thu, Feb 15, 2001 at 03:02:10PM -0800, Nathan Wiger wrote: > If we're interested in increased CPAN quality, there's a bunch of stuff > we can do. See also, CPANTS (totally vaporware, but its a plan) http:[EMAIL PROTECTED]/msg00148.html > Heck, I'd even volunteer to head up a project to do th

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Edward Peschko
> It was suggested to DWIM when I use my in void context, and not when > my isn't used in void context. With the above example, such a rule > would mean '$bar1' is my()ed, and '$bar2' isn't. That's IMO, very hard > to explain, very hard to bugtrack and totally unexpected. Even if not > everyone us

Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)

2001-02-15 Thread Nathan Wiger
[resent to perl6-language, sorry for any duplicates] Edward Peschko wrote: > > > I personally think that this is something Larry is going to have to > > decide. However, I would like to note that leaving these off by default > > lowers the transition curve to Perl 6 immensely for those people th

Re: Closures and default lexical-scope for subs

2001-02-15 Thread abigail
On Thu, Feb 15, 2001 at 02:03:21PM -0800, Edward Peschko wrote: > > If I have: > > > > (my $foo1, $bar1) = (my $foo2, $bar2) = ("foo", "bar"); > > > > then '(my $foo1, $bar1)' is in void context, while '(my $foo2, $bar2)' > > isn't. > > > > Do you really want them to behave differently? > >

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Edward Peschko
> If I have: > > (my $foo1, $bar1) = (my $foo2, $bar2) = ("foo", "bar"); > > then '(my $foo1, $bar1)' is in void context, while '(my $foo2, $bar2)' > isn't. > > Do you really want them to behave differently? > > > best way to shoot down my suggestion is an example where existing behaviour

Re: Closures and default lexical-scope for subs

2001-02-15 Thread abigail
On Thu, Feb 15, 2001 at 08:19:27PM +, Nicholas Clark wrote: > On Thu, Feb 15, 2001 at 09:05:55PM +0100, [EMAIL PROTECTED] wrote: > > On Thu, Feb 15, 2001 at 11:23:10AM -0800, Nathan Wiger wrote: > > > But I have never found a situation where this is so useful to justify > > > the other problem

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Edward Peschko
> >So... what was the rationale against it? > > Best read the archives... I am the wrong person to ask for a statement of > the opposing viewpoint... hey... I'm a lazy guy.. ;-) So - I guess coming from someone who holds the opposing viewpoint, what was it? Ed

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Nathan Wiger
Peter Scott wrote: > > >And in any case, make '-e' have the additional connotation that implies > >'no strict', and 'no warn'. > > no 'warnings' > > > Seems simple enough to me. > > Yes, that's what I thought; but this has generated more heat than light, at > least on the times I've brought i

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Peter Scott
At 01:03 PM 2/15/01 -0800, Edward Peschko wrote: > > http:[EMAIL PROTECTED]/msg00025.html > >Well, I agree with pretty much everything you said, except I like '-q' better >than '-z' for aesthetic reasons. > >So... what was the rationale against it? Best read the archives... I am the wrong person

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Edward Peschko
> >And in any case, make '-e' have the additional connotation that implies > >'no strict', and 'no warn'. > > no 'warnings' thanks. 'no warnings' > > Seems simple enough to me. > Yes, that's what I thought; but this has generated more heat than light, at > least on the times I've brought it

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Peter Scott
At 12:43 PM 2/15/01 -0800, Edward Peschko wrote: >On Thu, Feb 15, 2001 at 02:40:52PM -0600, Jonathan Scott Duff wrote: > > On Thu, Feb 15, 2001 at 12:25:44PM -0800, Edward Peschko wrote: > > > well, I was thinking about this - there really should be an extra > switch that > > > makes this possibl

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Edward Peschko
On Thu, Feb 15, 2001 at 02:40:52PM -0600, Jonathan Scott Duff wrote: > On Thu, Feb 15, 2001 at 12:25:44PM -0800, Edward Peschko wrote: > > well, I was thinking about this - there really should be an extra switch that > > makes this possible, rather than typing 'no strict; no warn;' ie: > > > > #!

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Jonathan Scott Duff
On Thu, Feb 15, 2001 at 12:25:44PM -0800, Edward Peschko wrote: > well, I was thinking about this - there really should be an extra switch that > makes this possible, rather than typing 'no strict; no warn;' ie: > > #!/usr/local/bin/perl -q # for quick and dirty. We already have a switch that me

Re: Closures and default lexical-scope for subs

2001-02-15 Thread John Porter
Branden wrote: > > > > There was more heated discussion in the thread rooted at > > http://www.mail-archive.com/perl6-language@perl.org/msg01089.html > > the discussion of RFC 16. > > Well, actually, I read that, and it pretty much discusses making `strict' > default or not (which I believe is no

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Edward Peschko
> Still would be able to do it with `use strict'. My proposal isn't going to > replace it! As it didn't replace the default global variables! As I said, I > don't want you to use it or even like it, I'm only wanting YAWTDI. Right, but your approach isn't going to help in the cases where it is nee

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Nicholas Clark
On Thu, Feb 15, 2001 at 09:05:55PM +0100, [EMAIL PROTECTED] wrote: > On Thu, Feb 15, 2001 at 11:23:10AM -0800, Nathan Wiger wrote: > > But I have never found a situation where this is so useful to justify > > the other problems it creates. However, there may well be true technical > > reasons why

Re: Closures and default lexical-scope for subs

2001-02-15 Thread abigail
On Thu, Feb 15, 2001 at 10:44:24AM -0800, Peter Scott wrote: > > Quite. But on a tangent, I see no good reason why this shouldn't be given > the same interpretation as "my ($a, $b, $c)" on the grounds that functions > taking list arguments that omit their parentheses swallow up the following

Re: Closures and default lexical-scope for subs

2001-02-15 Thread abigail
On Thu, Feb 15, 2001 at 11:23:10AM -0800, Nathan Wiger wrote: > > I agree with this statement. Perhaps someone who was around during the > initial 'my' discussions can shed some light on why it binds so tightly. > I have observed you can do something like this: > >my $OUTER = ''; > >if

Re: Closures and default lexical-scope for subs

2001-02-15 Thread abigail
On Thu, Feb 15, 2001 at 11:49:44AM -0800, Randal L. Schwartz wrote: > > "Peter" == Peter Scott <[EMAIL PROTECTED]> writes: > > Peter> Quite. But on a tangent, I see no good reason why this shouldn't be > Peter> given the same interpretation as "my ($a, $b, $c)" on the grounds that > Peter> f

Re: Closures and default lexical-scope for subs

2001-02-15 Thread abigail
On Thu, Feb 15, 2001 at 11:08:47AM -0800, Edward Peschko wrote: > > However, that still doesn't get rid of the gotchas - personally I think that: > > my $a, $b, $c; > > should be an error, a warning, or DWIM. Especially: Personally, I don't think so. GetOptions (foo => \my $foo,

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Peter Scott
At 11:49 AM 2/15/01 -0800, Randal L. Schwartz wrote: > > "Peter" == Peter Scott <[EMAIL PROTECTED]> writes: > >Peter> Quite. But on a tangent, I see no good reason why this shouldn't be >Peter> given the same interpretation as "my ($a, $b, $c)" on the grounds that >Peter> functions taking lis

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Branden
John Porter wrote: > Branden wrote: > > > > Well, I checked the archives, and I found that the discussion begun in > > http:[EMAIL PROTECTED]/msg01441.html > > That thread was rather tame; even so, I believe the end result, > if one can be deduced, is that the proposal is not a good one. > > There

Re: Closures and default lexical-scope for subs

2001-02-15 Thread John Porter
Branden wrote: > > > If you had this 'use scope' pragma, this auto-error checking would be > > compromised severely. > > Actually, I think sometimes it can be done with -w (``Variable xyz used only > once, probably spelling error''). Except that only applies to un-declared variables, which curr

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Randal L. Schwartz
> "Peter" == Peter Scott <[EMAIL PROTECTED]> writes: Peter> Quite. But on a tangent, I see no good reason why this shouldn't be Peter> given the same interpretation as "my ($a, $b, $c)" on the grounds that Peter> functions taking list arguments that omit their parentheses swallow up Peter> t

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Branden
Edward Peschko wrote: > > Tell me one. I couldn't find it. > > The main problem I see is cross checking. I *like* having to declare things as > 'my' - it catches my errors for me: > > my $variable; > $varaible = 1; # mis-spelled - caught by 'use strict'. > Still would be able to do it with `use s

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Nathan Wiger
Peter Scott wrote: > > At 01:15 PM 2/15/01 -0500, John Porter wrote: > > > my $a, $b, $c;# only $a is lexically scoped > > Quite. But on a tangent, I see no good reason why this shouldn't be given > the same interpretation as "my ($a, $b, $c)" on the grounds that functions > tak

Re: Closures and default lexical-scope for subs

2001-02-15 Thread David Grove
Dan Sugalski <[EMAIL PROTECTED]> wrote: > At 04:38 PM 2/15/2001 -0300, Branden wrote: > > >Yeah. Beginners. I was one too. And I remember always falling on these... > >But that's OK, since we probably don't want any new Perl programmers... > > I've skipped pretty much all this thread so fa

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Edward Peschko
> Take PHP and Python, for example. > > > > > my $a, $b, $c;# only $a is lexically scoped > > RTFM. > > > my ($a) = ; # after deducing (by the above) . . . > > > # when I wanted only the first line. > > Silly beginner gotchas. It's not an i

Re: Closures and default lexical-scope for subs

2001-02-15 Thread John Porter
Branden wrote: > > Take PHP and Python, for example. O.k., that's two out of the three modern languages. That's "most". Sorry, I stand corrected. > > Silly beginner gotchas. It's not an inconsistency of the > > language by any means. > > Yeah. Beginners. I was one too. And I remember always

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Dan Sugalski
At 04:38 PM 2/15/2001 -0300, Branden wrote: >Yeah. Beginners. I was one too. And I remember always falling on these... >But that's OK, since we probably don't want any new Perl programmers... I've skipped pretty much all this thread so far, but I do need to point out that perl isn't targeted at

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Peter Scott
At 01:15 PM 2/15/01 -0500, John Porter wrote: > > my $a, $b, $c;# only $a is lexically scoped > >RTFM. Quite. But on a tangent, I see no good reason why this shouldn't be given the same interpretation as "my ($a, $b, $c)" on the grounds that functions taking list arguments that

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Branden
John Porter wrote: > > Well, first let me say why I think a way (pragma) to do lexical-scope by > > default (for one file/block/scope) would be good. Most (modern) languages do > > it > This is false. Even languages in which lexical variables are the > norm still require a variable declaration; i

Re: Closures and default lexical-scope for subs

2001-02-15 Thread John Porter
Branden wrote: > > Well, I checked the archives, and I found that the discussion begun in > http:[EMAIL PROTECTED]/msg01441.html That thread was rather tame; even so, I believe the end result, if one can be deduced, is that the proposal is not a good one. There was more heated discussion in th

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Branden
Jonathan Scott Duff wrote: > On Thu, Feb 15, 2001 at 01:40:53PM -0300, Branden wrote: > > I propose the introduction of two new keywords (just like `my' and `our') > > for specifying a different scope: `global' and `outer'. `global' would be > > used to say that a specific variable or a list of th

Re: Closures and default lexical-scope for subs

2001-02-15 Thread Jonathan Scott Duff
On Thu, Feb 15, 2001 at 01:40:53PM -0300, Branden wrote: > I propose the introduction of two new keywords (just like `my' and `our') > for specifying a different scope: `global' and `outer'. `global' would be > used to say that a specific variable or a list of them would refer to the > global vari

  1   2   >