octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #36376] make nargin(fcn_name) work with anonym


From: anonymous
Subject: [Octave-bug-tracker] [bug #36376] make nargin(fcn_name) work with anonymous functions
Date: Thu, 03 May 2012 06:51:00 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0

URL:
  <http://savannah.gnu.org/bugs/?36376>

                 Summary: make nargin(fcn_name) work with anonymous functions
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Do 03 Mai 2012 06:50:59 UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Tilman Schröder
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.4.3
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

Heyho,

in Matlab, nargin is able to tell the number of arguments of anonymous
functions. In Octave, fcn_name has to be the name of an M-file, so nargin does
not work with anonymous functions:


octave:1> f = @(x,y) x^2 + y^2;
octave:2> nargin(f);
error: octave_base_value::convert_to_str_internal (): wrong type argument
`function handle'
error: nargin: FCN_NAME must be a string
octave:3> nargin('f');
error: nargin: invalid function
octave:6> nargin('test')
ans =  3


with the function M-file test.m.

It would be nice to have Octave return the correct number of input arguments
for anonymous functions and, (possibly), work with function handles directly,
not only with function names as strings.

Bye,
Tilman




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?36376>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

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