Re: Re: PHP 6.0 Wishlist
| From: | George Schlossnagle | Date: | Sat, 13 Aug 2005 22:06:43 +0000 |
| Subject: | Re: Re: PHP 6.0 Wishlist | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-18003@lists.php.net to get a copy of this message | ||
On Aug 13, 2005, at 5:57 PM, Andrey Hristov wrote:
George Schlossnagle wrote:Possibly, which would fall inline with not being against them now. :) I like them in Python. The ones in Perl are a hack, though, with limitations on how they can be positioned, lack of prototyping and default values, etc. The Python ones are much more flexible, imho. The only difference between Perl's support for named params and PHP's current support is that in Perl: foo( a => 1, b => 2) is the same as foo((a => 1, b => 2)), i.e. that you have in Perl: (a => 1, b => 2) whereas in PHP we have array('a' => 1, 'b' => 2);On Aug 13, 2005, at 5:49 PM, Andrey Hristov wrote:I could be wrong, but I think you were the one who first wanted named parameters that long time ago :)George Schlossnagle wrote::) I'm not against named parameters. Python's support for them is nice as well. But Perl doesn't support named parameters any different than can be done currently in PHP. GeorgeOn Aug 13, 2005, at 11:46 AM, Matthew Weier O'Phinney wrote:Well, this idea I think comes from Python. Last time I checked they had these and as far as I remember this have been brought 2 times. The first time before 5.0 and has been rescheduled for 6.0 :)* Christian Schneider <cschneid@cschneid.com> :Huh? Perl doesn't have true support for this anyway, just a simpler syntax for hashrefs. If you want Perlish named params this is 100% identical to doing foo(array('id' => 42, 'name' => 'foo')); George9. Named parameters. Preferred way would be via array()-less array collation as we are already using this in our production system ;-) : foo('id' => 42, 'name' => "foo");+1 -- this is one of the biggest things I miss coming from perl to PHP.
AndreyGeorge Schlossnagle -- Vice President of Engineering -- OmniTI Computer Consulting -- http://www.omniti.com