Re: [PHP-DEV] Named arguments revisited

2005-12-01 Thread Sebastian Kugler
On 12/1/05, Jared White <[EMAIL PROTECTED]> wrote: > I still say its main selling point is > that the calling code is its own API documentation. why don't you just write something like cycle(/* name: */ "myCycle", /* values: */ "#ee;#d0d0d0", /* print: */ false, /* reset: */ true, /* delimite

Re: [PHP-DEV] Named arguments revisited

2005-12-01 Thread Jared White
On Dec 1, 2005, at 11:16 AM, Sebastian Kugler wrote: On 12/1/05, Jared White <[EMAIL PROTECTED]> wrote: I still say its main selling point is that the calling code is its own API documentation. why don't you just write something like cycle(/* name: */ "myCycle", /* values: */ "#ee;#d0d0d

Re: [PHP-DEV] Named arguments revisited

2005-12-01 Thread Jared White
On Dec 1, 2005, at 6:59 AM, Christian Schneider wrote: Ron Korving wrote: Named parameter example: Your example misses the main advantage of named parameters IMHO: Sets of parameters you don't want to or can't explicitely list because they are not know yet. function adduser($params)

Re: [PHP-DEV] Named arguments revisited

2005-12-01 Thread Christian Schneider
Ron Korving wrote: Named parameter example: Your example misses the main advantage of named parameters IMHO: Sets of parameters you don't want to or can't explicitely list because they are not know yet. function adduser($params) { if (!is_array($params)) throw new Exception('No nam

Re: [PHP-DEV] Named arguments revisited

2005-11-30 Thread Ron Korving
You could use an associative array, but then you have a not-so-clean syntax and you have to handle default values for missing parameters yourself. Named parameter example: Traditional named example: 'root', 'password' => 'abcdefg', 'superuser' => true)); ?> You see the big advantages of na

Re: [PHP-DEV] Named arguments revisited

2005-11-30 Thread Bart de Boer
Sorry... Forget I said that... Bart de Boer wrote: Hi Jared, If probably don't understand named arguments correclty but couldn't you do something like: function(array('name1' => 'val1', 'name2' => $var)); In the function you could then check which keys (names) have values, thereby simulati

Re: [PHP-DEV] Named arguments revisited

2005-11-30 Thread Bart de Boer
Hi Jared, If probably don't understand named arguments correclty but couldn't you do something like: function(array('name1' => 'val1', 'name2' => $var)); In the function you could then check which keys (names) have values, thereby simulating a form of named agruments? On Nov 29, 2005, a

Re: [PHP-DEV] Named arguments revisited

2005-11-30 Thread Jared White
On Nov 30, 2005, at 1:50 PM, Andrei Zmievski wrote: Can you explain your reasoning behind "essential for using PHP as a solid templating language" and "nothing is a good substitute for the real deal"? - Andrei OK, to take an example from Smarty, you could do a value cycle (for multi-row-

Re: [PHP-DEV] Named arguments revisited

2005-11-30 Thread Andrei Zmievski
Can you explain your reasoning behind "essential for using PHP as a solid templating language" and "nothing is a good substitute for the real deal"? - Andrei On Nov 29, 2005, at 11:17 PM, Jared White wrote: Named arguments are absolutely essential for using PHP as a solid templating language

[PHP-DEV] Named arguments revisited

2005-11-29 Thread Jared White
Hi folks, I just got on the list -- I've been a big fan of PHP for several years and am throughly enjoying PHP 5. Good work folks, and once I can get 5.1 set up on my OS X box I'm sure it's be even better. I've been very interested in hearing about PHP 6 feature discussions, and the meeti