develooper Front page | perl.perl5.porters | Postings from February 2008

Re: a warning I'd like to see

Thread Previous | Thread Next
From:
demerphq
Date:
February 18, 2008 01:38
Subject:
Re: a warning I'd like to see
Message ID:
9b18b3110802180138p1f7da9eau642fc910cd42554@mail.gmail.com
On 25/01/2008, Aristotle Pagaltzis <pagaltzis@gmx.de> wrote:
> * David Nicol <davidnicol@gmail.com> [2008-01-25 00:50]:
> > alert me when I give map an arrayref instead of an array
>
> Sorry, no. I've passed complex data structures to `map` more
> times than I care to remember. This wouldn't be a warning, it
> would be a nag screen.
>
> > $ perl -le 'use warnings; print join "|", map {$_ + 2} [ 1..6 ]'
> > 268504834
>
> This would be caught by the stricture that MJD proposed a few
> weeks ago, where stringifying or numifying references is
> forbidden. That would trap a bunch of hard-to-find mistakes I've
> made while almost never getting in my way. Let me start a new
> thread…

ST is one place where we could really use python style tuples.

It is slowed down quite a bit by the construction cost of
manufacturing loads of tiny little arrays. If we had tuples we could
make things like ST much more efficient.

Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | 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