help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: named arguments


From: Michael Goffioul
Subject: Re: named arguments
Date: Fri, 16 Mar 2012 12:11:34 +0000

On Fri, Mar 16, 2012 at 11:53 AM, Olaf Till <address@hidden> wrote:
> On Fri, Mar 16, 2012 at 12:21:19PM +0100, Juan Pablo Carbajal wrote:
>> Hi,
>> Looks like named arguments are still positional
>>
>> function namedarg (a,b='named b',c='named c')
>>  disp(b);
>>  disp(c);
>> end
>>
>> > namedarg(1)
>> named b
>> named c
>> > namedarg(1,b=0)
>> 0
>> named c
>> > namedarg(1,c=0)
>
> What you pass as second argument is just the value of the assignment
> "c=0", which is "0", no matter whether you call the variable assigned
> to "c" or something else.
>
> I'm not aware of Octave supporting named arguments. There was once a
> suggestion to support named arguments, but it has been disapproved
> because of the risk of future incompatibilities with Matlab.

Indeed. I think you (Juan) are confusing named arguments and argument
default values.

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]