develooper Front page | perl.perl6.language.strict | Postings from February 2001

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

Thread Next
From:
Edward Peschko
Date:
February 20, 2001 16:35
Subject:
Re: Warnings, strict, and CPAN (Re: Closures and default lexical-scope for subs)
Message ID:
20010220163451.B13375@excitehome.net
> > 
> > Can you give me an example of the former?
> > I can't think of any off the top of my head.
> 
> Scalar value @foo[$bar] better written as $foo[$bar], for one.
> 
> If part of Perl's breeding is autovivication and interpretation of undef as 
> 0 or "" in the appropriate context, why should Perl bitch at me if I use it 
> as such?  Why should I have to ask permission to do so?

Well, for one, your example is ill-considered. You are going to get 
autovivification saying:

@foo[$bar] = 1;

just as much as you are going to get autovivification for:

$foo[$bar] = 1;

Hence I'd say that @foo[$bar] has NO INTRINSIC VALUE whatsoever.

Second, with the keyword empty (if it comes to pass) the reasons for 
interpretation of undef as 0 and "" go away. Right now, things are a PITA 
to get empty values:

my ($a, $b, $c, $d, $e) = ('') x 5;

With empty:

my ($a, $b, $c, $d, $e) = empty;

> I would rather say, and I think it would be more perlish to say, "I'm not 
> feeling particularly perly today, can you check for anything clever, cause 
> if there is, chances are it's a mistake."

Or how about "I'm feeling particularly lazy today, I think I'll sleep in. Lets
worry about any mistakes I might make another day."

For i maintain that any 'cleverness' that you might have that causes warnings 
in perl6 will *probably* be a mistake.

Ed

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About