On Tue, Sep 25, 2001 at 11:36:25AM +0300, Andrey Hristov wrote:
: 
:  After some days spent in a hospital reading "Programming Perl" and
: "Oracle Web Applications" I found that a language construct which
: appears in Perl and PL/SQL is not available in PHP.
: As in most 3G languages function call is like that
: $bar=foo($bar1,$bar2,$bar3,'bar4');
: 
: function foo($par1=1,$par2=2,$par3=3,$par4='foo_bar',...){
: ...
: }
: In the case when I've few parameters I've to remember their order, so why not
: $bar=foo('par2'=>10);
: I want to pass value to only one or more but not to all params. Also
: this will make the code clearer I think.

AFAIK, Perl doesn't support named parameters (it's listed for Perl 6).
Since C does not support this, almost all C-like languages also do not
support this.  The only exception I know of is Objective-C, which is the
base language for Apple's new Unix-based Mac OS X.

As for PHP supporting named parameters, it seems silly to preserve C's
use of parentheses.  Why not do something more radical like Objective-C
that draws from Smalltalk syntax:

        $bar = [foo par2:10]


-- 
Eugene Lee
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to