octave-maintainers
[Top][All Lists]
Advanced

[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 11:20:11 +0100

>  would it be possible
>  1) to be able to declare named arguments AFTER varargin
>  2) to ensure the same strict mapping, i.e. unnamed parameters go to
>  varargin, named ones are matched against the list of named arguments, named
>  ones without matching being flagged as errors ?

No. This would break compatibility. The call you used above:

hello(closing="and the rest")

is not a call by named argument like in R, Python or Fortran, rather
it is equivalent to

closing="and the rest" ; hello(closing)

i.e. you use an assignment expression. I guess there's little point
arguing which feature is more useful; certainly, both are useful, but
unfortunately they cannot be used clearly together.



-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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