Skip Menu |
 

This queue is for tickets about the Scalar-List-Utils CPAN distribution.

Report information
The Basics
Id: 60295
Status: rejected
Priority: 0/
Queue: Scalar-List-Utils

People
Owner: Nobody in particular
Requestors: justincase [...] yopmail.com
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 1.23
Fixed in: (no value)



Subject: first() should be able to take EXPR as first arg, just like grep() and map()
Download (untitled) / with headers
text/plain 186b
It would be nice if List::Util::first() can take either a BLOCK or an EXPR as the first argument, just like grep() and map() can, since it's structurally very similar to those functions.
Subject: Re: [rt.cpan.org #60295] first() should be able to take EXPR as first arg, just like grep() and map()
Date: Thu, 12 Aug 2010 18:58:00 -0500
To: bug-Scalar-List-Utils [...] rt.cpan.org
From: Graham Barr <gbarr [...] pobox.com>
Download (untitled) / with headers
text/plain 474b
On Aug 12, 2010, at 5:31 PM, Justin Case via RT wrote: Show quoted text
> It would be nice if List::Util::first() can take either a BLOCK or an > EXPR as the first argument, just like grep() and map() can, since it's > structurally very similar to those functions.
It is not possible. grep and map are builtin keywords to perl. during parsing perl detects the expressions and turns them into blocks first() itself is a subroutine and so the first arg has to be a code reference Graham.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.