bugGNU Octave - Bugs: bug #34857, feval() version that takes...

 
 

bug #34857: feval() version that takes arbitrary length argument list

Submitted by:  Patrick Gosling <jpmg>
Submitted on:  Fri 18 Nov 2011 02:56:13 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Feature Request
Status: InvalidAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.4.3Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 18 Nov 2011 03:51:36 PM UTC, comment #3:

No problem.

John W. Eaton <jwe>
Project Administrator
Fri 18 Nov 2011 03:37:19 PM UTC, comment #2:

I'm embarrassed now (and slightly confused as to how I convinced myself this didn't work).

Apologies! [ and thank you very much for the reply ]

Patrick Gosling <jpmg>
Fri 18 Nov 2011 03:27:29 PM UTC, comment #1:

Is there some reason that

won't work for you?

John W. Eaton <jwe>
Project Administrator
Fri 18 Nov 2011 02:56:13 PM UTC, original submission:

When attempting to marshall a call to feval(), it is often the case that the length of the argument list being presented is not known until run time.

Currently, the only way I can see of addressing this is to switch with a case for each plausible number of arguments, but that is clearly very unsatisfactory.

An enhancement would be to either

a) have a variable-arguments version called perhaps va_feval() or vfeval() or similar, which would take two arguments - a function handle, and a cell array containing the arbitrary length argument list to be passed to the called function.

b) have a special case for feval(), where if it was passed exactly two arguments and the second argument was a cell array, that it was assumed that the cell array should be treated as the argument list for the function called.

The latter is tempting (in terms of avoiding duplicating code within the octave interpreter), but is not backwards compatible, and breaks compatibility with matlab.

Implementation in either case is fairly straightforward (I'd be happy to do the necessary).

Patrick Gosling <jpmg>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by jpmg (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 18 Nov 2011 03:51:36 PM UTCjweStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1