Re: [PHP-DEV] Skipping of defaulted parameters.

2010-10-21 Thread Pas
On 2010.10.21. 12:56, Richard Quadling wrote: On 21 October 2010 11:45, Ionut G. Stan wrote: On 21/Oct/10 1:17 PM, Richard Quadling wrote: On 21 October 2010 08:52, Ionut G. Stanwrote: Option 5: Implement named parameters? Come on, play fair. I know all about the named parameters and

Re: [PHP-DEV] Skipping of defaulted parameters.

2010-10-21 Thread Richard Quadling
On 21 October 2010 11:45, Ionut G. Stan wrote: > On 21/Oct/10 1:17 PM, Richard Quadling wrote: >> >> On 21 October 2010 08:52, Ionut G. Stan  wrote: >>> >>> Option 5: Implement named parameters? >>> >> >> Come on, play fair. I know all about the named parameters and I didn't >> mention them. > > W

Re: [PHP-DEV] Skipping of defaulted parameters.

2010-10-21 Thread Ionut G. Stan
On 21/Oct/10 1:17 PM, Richard Quadling wrote: On 21 October 2010 08:52, Ionut G. Stan wrote: Option 5: Implement named parameters? Come on, play fair. I know all about the named parameters and I didn't mention them. Where's the unfairness? I proposed them because the issue you raised is

Re: [PHP-DEV] Skipping of defaulted parameters.

2010-10-21 Thread Richard Quadling
On 21 October 2010 09:11, Stan Vass wrote: >>> Option 4 would probably be the worse one to go for. Looking any number >>> of languages that support defaults and you will see code like ... >>> >>> someFunction(param1,param7param11) >> >> It does get ugly fast for large numbers of arguments.

Re: [PHP-DEV] Skipping of defaulted parameters.

2010-10-21 Thread Richard Quadling
On 21 October 2010 08:52, Ionut G. Stan wrote: > > Option 5: Implement named parameters? > Come on, play fair. I know all about the named parameters and I didn't mention them. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP Internals - PHP Ru

Re: [PHP-DEV] Skipping of defaulted parameters.

2010-10-21 Thread Michael Shadle
On Thu, Oct 21, 2010 at 1:10 AM, Ferenc Kovacs wrote: > With #6, you would lose the argument hinting(either be native, or phpdoc) > feature for your method. you would, however a) it's already supported b) there's no language changes required c) do your own typecasting, sanity checking, bounds c

Re: [PHP-DEV] Skipping of defaulted parameters.

2010-10-21 Thread Stan Vass
Option 4 would probably be the worse one to go for. Looking any number of languages that support defaults and you will see code like ... someFunction(param1,param7param11) It does get ugly fast for large numbers of arguments... But any function with more than a handful of arguments is a

Re: [PHP-DEV] Skipping of defaulted parameters.

2010-10-21 Thread Ferenc Kovacs
On Thu, Oct 21, 2010 at 9:56 AM, Michael Shadle wrote: > On Thu, Oct 21, 2010 at 12:52 AM, Ionut G. Stan > wrote: > > > Option 5: Implement named parameters? > > Option 6: do as other have and just pass an array yourself... > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsub

Re: [PHP-DEV] Skipping of defaulted parameters.

2010-10-21 Thread Michael Shadle
On Thu, Oct 21, 2010 at 12:52 AM, Ionut G. Stan wrote: > Option 5: Implement named parameters? Option 6: do as other have and just pass an array yourself... -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Skipping of defaulted parameters.

2010-10-21 Thread Ionut G. Stan
On 20/Oct/10 2:58 PM, Richard Quadling wrote: Hello. Take the following simple code. According to the manual A variable is considered to be null if it has not been set to any value yet [1]. By default, function arguments are passed by value [2]. When using default arguments, any defaults sho

RE: [PHP-DEV] Skipping of defaulted parameters.

2010-10-20 Thread Will Fitch
be caught there without running into any value clashing issues. -Original Message- From: Stas Malyshev [mailto:smalys...@sugarcrm.com] Sent: Wednesday, October 20, 2010 1:37 PM To: rquadl...@googlemail.com Cc: Richard Quadling; PHP internals Subject: Re: [PHP-DEV] Skipping of defaulted

Re: [PHP-DEV] Skipping of defaulted parameters.

2010-10-20 Thread Stas Malyshev
Hi! 3 - New keyword of default or void to specifically indicate the intent to use the default value for the argument. Actually, 'default' is already a keyword (switch!), while _ is an actual function name (gettext). So default, syntactically, can work, while _ can't. -- Stanislav Malyshev,

Re: [PHP-DEV] Skipping of defaulted parameters.

2010-10-20 Thread Richard Lynch
On Wed, October 20, 2010 6:58 am, Richard Quadling wrote: > foo(10,, 30); // Parse error. I thought this used to work... > I would argue that by having a null in the arguments, the intent is to > NOT supply a value and have the default value used in the function. Unfortunately, no. There are ti

[PHP-DEV] Skipping of defaulted parameters.

2010-10-20 Thread Richard Quadling
Hello. Take the following simple code. According to the manual A variable is considered to be null if it has not been set to any value yet [1]. By default, function arguments are passed by value [2]. When using default arguments, any defaults should be on the right side of any non-default argu