bugGNU Octave - Bugs: bug #53118, char ( function_handle ) throws...

 
 

bug #53118: char ( function_handle ) throws error

Submitter:  -X- <jsh>
Submitted:  Sun 11 Feb 2018 05:21:00 AM UTC
   
 
Category:  Interpreter Severity:  2 - Minor
Priority:  3 - Low Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 27 Oct 2018 01:52:49 AM UTC, comment #3: 

Works just fine now.  Marking as fixed and closing report.

Rik <rik5>
Group administrator
Fri 26 Oct 2018 07:01:58 PM UTC, comment #2: 

I pushed the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/7eeb89b0d2d5

Works for me now.

John W. Eaton <jwe>
Group administrator
Sun 11 Feb 2018 04:05:12 PM UTC, comment #1: 

Confirmed.  The wider issue is that function handles probably need to implement an overload of the char function which just returns the string version of them.

For example,


octave:2> f = @(x) x^2 + 1
f =

@(x) x ^ 2 + 1


Clearly there are routines that understand how to print the string representation of a function handle.

But,


char (f)
error: octave_base_value::convert_to_str_internal (): wrong type argument 'function handle'


This is the case with all function handles including handles to built-in functions.


octave:3> char (@plus)
error: octave_base_value::convert_to_str_internal (): wrong type argument 'function handle'



Rik <rik5>
Group administrator
Sun 11 Feb 2018 05:21:00 AM UTC, original submission:  

Octave char( @function_handle ) for example char(@plus) throws an error when it should simply return the name of the function as a char string.

-X- <jsh>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jsh (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-10-27 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2018-10-26 jwe StatusConfirmed Ready For Test
    2018-02-11 rik5 Release4.2.1 dev
    2018-02-11 rik5 Severity3 - Normal 2 - Minor
        Priority5 - Normal 3 - Low
        StatusNone Confirmed
        Summarychar( @function_handle ) throws error char ( function_handle ) throws error

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code