Re: RFC 12 (v3) variable usage warnings

2000-09-21 Thread Michael Fowler
On Thu, Sep 21, 2000 at 10:59:19AM -0700, Steve Fink wrote: > For lexicals, a use without a declaration makes no sense, because > variables default to global (non-lexical). A use without an > initialization is of arguable utility, because your defined() tests may > already be intended to check fo

Re: RFC 12 (v3) variable usage warnings

2000-09-21 Thread Steve Fink
Michael Fowler wrote: > > Ok, at this point I'm trying to clear up misunderstandings. I believe you > know where I stand with relation to your RFC. Thanks, you caught several of my mistakes. > > On Wed, Sep 20, 2000 at 06:41:52PM -0700, Steve Fink wrote: > > Michael Fowler wrote: > > > > Exc

Re: RFC 12 (v3) variable usage warnings

2000-09-21 Thread Steve Fink
Eric Roode wrote: > > Steve Fink, via the Perl6 Librarian, wrote: > >=head2 EXAMPLE > > > >1 my ($x, $y, $z, $r); > >2 $z = 1; > >3 f(\$r); > >4 my $logfile = "/tmp/log"; > >5 $x = 1 if cond(); > >6 print $x+$y; > >7 undef $z; > >8 print $z; > > > [...] > >No warni

Re: RFC 12 (v3) variable usage warnings

2000-09-21 Thread Eric Roode
Steve Fink, via the Perl6 Librarian, wrote: >=head2 EXAMPLE > >1 my ($x, $y, $z, $r); >2 $z = 1; >3 f(\$r); >4 my $logfile = "/tmp/log"; >5 $x = 1 if cond(); >6 print $x+$y; >7 undef $z; >8 print $z; > [...] >No warning is issued for C<$r> because any variable whose

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Michael Fowler
Ok, at this point I'm trying to clear up misunderstandings. I believe you know where I stand with relation to your RFC. On Wed, Sep 20, 2000 at 06:41:52PM -0700, Steve Fink wrote: > Michael Fowler wrote: > > Except for the line number reported, which is the important part. > > Oh. Certainly yo

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Steve Fink
Tom Christiansen wrote: > > >Tom Christiansen wrote: > >> > >> >It happens when I don't bother to declare something. My company has > >> >several dozen machines with an 'our'-less perl, and 'use vars qw($x)' is > >> >a pain. As is $My::Package::Name::x. > >> > >> Far, far easier to fix behavioral

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Tom Christiansen
>Tom Christiansen wrote: >> >> >It happens when I don't bother to declare something. My company has >> >several dozen machines with an 'our'-less perl, and 'use vars qw($x)' is >> >a pain. As is $My::Package::Name::x. >> >> Far, far easier to fix behavioral problems than to hack Perl. >> >> --t

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Steve Fink
Michael Fowler wrote: > > On Wed, Sep 20, 2000 at 05:20:54PM -0700, Steve Fink wrote: > > > $foobal = 3; > > > if (@ARGV) { > > > $foobar = @ARGV; > > > } > > > > > > print $foobar; > > > > > > Only warn me that $foobar is uninitialized? I always prefer it when the > > >

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Michael Fowler
On Wed, Sep 20, 2000 at 05:20:54PM -0700, Steve Fink wrote: > > $foobal = 3; > > if (@ARGV) { > > $foobar = @ARGV; > > } > > > > print $foobar; > > > > Only warn me that $foobar is uninitialized? I always prefer it when the > > actual source of my problem is pointed out,

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Steve Fink
Tom Christiansen wrote: > > >It happens when I don't bother to declare something. My company has > >several dozen machines with an 'our'-less perl, and 'use vars qw($x)' is > >a pain. As is $My::Package::Name::x. > > Far, far easier to fix behavioral problems than to hack Perl. > > --tom Not s

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Steve Fink
Michael Fowler wrote: > > On Wed, Sep 20, 2000 at 03:25:11PM -0700, Steve Fink wrote: > > > > complains, but > > > > > > > > $x = 3; $x = 3 > > > > > > As it shouldn't; you've mentioned $x twice, which means you probably didn't > > > misspell it. That your mentioning twice in this manner is sil

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Tom Christiansen
>It happens when I don't bother to declare something. My company has >several dozen machines with an 'our'-less perl, and 'use vars qw($x)' is >a pain. As is $My::Package::Name::x. Far, far easier to fix behavioral problems than to hack Perl. --tom

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Steve Fink
> >Which is silly, because you shouldn't have to say '$x = $x = 3' when you > >mean '$x = 3'. Just because there's a real reason behind it doesn't make it > >any less silly. > > I'd like to see where this can happen. Sounds like someone forgot to > declare something: > > our $x; > $x =

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Michael Fowler
On Wed, Sep 20, 2000 at 05:10:55PM -0600, Tom Christiansen wrote: > >Which is silly, because you shouldn't have to say '$x = $x = 3' when you > >mean '$x = 3'. Just because there's a real reason behind it doesn't make it > >any less silly. > > I'd like to see where this can happen. Sounds like

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Tom Christiansen
>Which is silly, because you shouldn't have to say '$x = $x = 3' when you >mean '$x = 3'. Just because there's a real reason behind it doesn't make it >any less silly. I'd like to see where this can happen. Sounds like someone forgot to declare something: our $x; $x = 2; --tom

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Michael Fowler
On Wed, Sep 20, 2000 at 03:25:11PM -0700, Steve Fink wrote: > > > complains, but > > > > > > $x = 3; $x = 3 > > > > As it shouldn't; you've mentioned $x twice, which means you probably didn't > > misspell it. That your mentioning twice in this manner is silly is beyond > > perl's grasp. > > Ac

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Steve Fink
Michael Fowler wrote: > > On Wed, Sep 20, 2000 at 07:45:16PM -, Perl6 RFC Librarian wrote: > > "VARIABLE used only once: possible typo" should be replaced with > > warnings on uses of uninitialized variables (including lexicals). > > > $x = 3 > > I don't understand, who's to say you didn't

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Michael Fowler
On Wed, Sep 20, 2000 at 07:45:16PM -, Perl6 RFC Librarian wrote: > "VARIABLE used only once: possible typo" should be replaced with > warnings on uses of uninitialized variables (including lexicals). > $x = 3 I don't understand, who's to say you didn't misspell $x? If you're only using it

RFC 12 (v3) variable usage warnings

2000-09-20 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE variable usage warnings =head1 VERSION Maintainer: Steve Fink <[EMAIL PROTECTED]> Date: 2 Aug 2000 Last Modified: 20 Sep 2000 Mailing List: [EMAIL PROTECTED] Number: 12 Version: 3 Status: Deve