[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: named arguments
From: |
Juan Pablo Carbajal |
Subject: |
Re: named arguments |
Date: |
Fri, 16 Mar 2012 13:18:43 +0100 |
On Fri, Mar 16, 2012 at 1:11 PM, Michael Goffioul
<address@hidden> wrote:
> 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.
Ok, I see. Then we have default values for arguments but not named
arguments. Good. Thanks!
--
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Zürich
http://ailab.ifi.uzh.ch/carbajal/
- named arguments, Juan Pablo Carbajal, 2012/03/16
- Re: named arguments, Olaf Till, 2012/03/16
- Re: named arguments, Michael Goffioul, 2012/03/16
- Re: named arguments,
Juan Pablo Carbajal <=
- Re: named arguments, Jordi Gutiérrez Hermoso, 2012/03/16
- Re: named arguments, Jordi Gutiérrez Hermoso, 2012/03/16
- Re: named arguments, Olaf Till, 2012/03/16
- Re: named arguments, John W. Eaton, 2012/03/16
- Re: named arguments, Jordi Gutiérrez Hermoso, 2012/03/16
- Re: named arguments, John W. Eaton, 2012/03/16
- Re: named arguments, Michael Goffioul, 2012/03/16
- RE: named arguments, Damian Harty, 2012/03/16
- Re: named arguments, Jordi Gutiérrez Hermoso, 2012/03/16
- Re: named arguments, fork, 2012/03/16