[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [OctDev] inputname and function(cell{:})
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: [OctDev] inputname and function(cell{:}) |
Date: |
Fri, 14 Sep 2012 09:46:02 -0400 |
On 14 September 2012 09:30, Lukas Reichlin
<address@hidden> wrote:
> Currently, with
>
> ret1 = testfun (arg1, arg2, arg3)
>
> nargin is 3 and inputname ranges from 1 to 3.
> But with
>
> ret2 = testfun (args{:})
>
> nargin is still 3 but only inputname(1) exists while inputname(2)
> and inputname(3) give errors.
But if you're passing a cs-list, the cs-list itself doesn't have the
variable names that you want, and inputname is working as documented,
returning an empty string.
> Therefore I must find an alternative to inputname or an alternative
> to nargin which counts input arguments the same way as inputname
> does. Do you know how to circumvent this problem?
What exactly is your actual problem? nargin still counts arguments,
but why do you want to know what the variables are called in the
calling function? The calling function doesn't have this information
when you use a cs-list. To me this seems like premature closure or an
X-Y problem:
http://www.perlmonks.org/index.pl?node_id=542341
Can you give broader context in order to be able to give you a better
answer? There may be a completely differenty way to solve your broader
problem.
- Jordi G. H.