[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: functions with 'named' arguments
From: |
Jaroslav Hajek |
Subject: |
Re: functions with 'named' arguments |
Date: |
Tue, 18 Mar 2008 13:24:20 +0100 |
>
> Excuse me ? What am I doing when I use, in R:
> meanemp(dist="Normale", 4, mean=10)
> meanemp(mean=10, dist="Normale", 4)
> ? What is the difference with the suggested
> hello(closing='bla') ?
>
What I'm trying to explain is that
hello(closing='bla') already *has* a meaning in Octave, and it is
*not* what you have
on mind. In R, this is no problem because the assignment is not "=".
In Fortran and Python, this is no problem because assignment is not an
expression (not sure about Python, but I think so).
It is perfectly legal in Octave (and sometimes useful) to write things like
x = exp (y = -y)
A possible solution would be to implement keyword arguments using
different character than "=", but I think that the standard workaround
using a cell array (of the form {"name", value, "name", value}) is
already good enough.
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
- functions with 'named' arguments, Dupuis, 2008/03/17
- Re: functions with 'named' arguments, Søren Hauberg, 2008/03/17
- Re: functions with 'named' arguments, Dupuis, 2008/03/18
- Re: functions with 'named' arguments, Søren Hauberg, 2008/03/18
- Re: functions with 'named' arguments, Dupuis, 2008/03/18
- Re: functions with 'named' arguments, Jaroslav Hajek, 2008/03/18
- Re: functions with 'named' arguments, Dupuis, 2008/03/18
- Re: functions with 'named' arguments, Shai Ayal, 2008/03/18
- Re: functions with 'named' arguments,
Jaroslav Hajek <=
- Re: functions with 'named' arguments, Dupuis, 2008/03/18
- Re: functions with 'named' arguments, Jaroslav Hajek, 2008/03/18
- Re: functions with 'named' arguments, Dupuis, 2008/03/19
- Re: functions with 'named' arguments, Shai Ayal, 2008/03/19
- Re: functions with 'named' arguments, Jaroslav Hajek, 2008/03/19
- Re: functions with 'named' arguments, John W. Eaton, 2008/03/19
- Re: functions with 'named' arguments, Dupuis, 2008/03/21
- Re: functions with 'named' arguments, John W. Eaton, 2008/03/27