Re: RFC 238 (v1) length(@ary) deserves a warning

2000-09-16 Thread Bart Lateur

On Sat, 16 Sep 2000 10:26:48 +0100, Hildo Biersma wrote:

 length(@ary) deserves a warning

Right now, the Lint back-end gives a warning in these cases (use of
array in scalar context).

Can we make the RFC more generic, and propose to move the Lint warnings
into the core?

But using arrays in a scalar context usually isn't an error.

-- 
Bart.



Re: RFC 238 (v1) length(@ary) deserves a warning

2000-09-16 Thread Nathan Wiger

Michael G Schwern wrote:
 
 I'm surprised there hasn't be a good overhaul of the prototyping
 system proposeed yet.  Your length() propsal wouldn't be the only
 think that can't be prototyped.  print() is the simplest example.

I think print should probably become something like what Eryq suggested:

   CORE::print { $main::DEFOUT-print(@_) }

With the function-style:

   print($FILE @data);

being handled by a more general mechanism to coerce it into:

   print $FILE (@data);

like the one in RFC 174 (v2 due out today, hopefully).

-Nate



Re: RFC 238 (v1) length(@ary) deserves a warning

2000-09-16 Thread Bart Lateur

On Sat, 16 Sep 2000 16:19:08 +0100, Hildo Biersma wrote:

 But using arrays in a scalar context usually isn't an error.

So, we make the warnings smarter and make sure they can be turned off...

And distinguish between simply an array in scalar context, and an array
used as an argument for length()?

In that case, we're back to square one.

I wouldn't mind a option in the core (or in a standard module) for
"extra picky warnings", though: much stricter than the current warnings
in Perl5.

-- 
Bart.



Re: RFC 238 (v1) length(@ary) deserves a warning

2000-09-15 Thread Michael G Schwern

On Sat, Sep 16, 2000 at 04:21:15PM +1100, Damian Conway wrote:
 I'm surprised there hasn't be a good overhaul of the prototyping
 system proposeed yet. 
 
 What exactly didn't you like about RFC 128???

Ummm... the fact that its title doesn't match /proto/.  My bad.

Okay, its a proposal to overhaul prototyping, cool.  But I don't see
anything to allow Clength $string and Clength @array live
together.  Its a big RFC, I probably missed it.

-- 

Michael G Schwern  http://www.pobox.com/~schwern/  [EMAIL PROTECTED]
Just Another Stupid Consultant  Perl6 Kwalitee Ashuranse
Cheating is often more efficient.
- Seven of Nine