bugGNU Octave - Bugs: bug #38958, parse error in function handle...

 
 

bug #38958: parse error in function handle returning string expression

Submitter:  Clemens Buchacher <drizzd>
Submitted:  Fri 10 May 2013 09:32:50 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Clemens Buchacher Open/Closed:  * Closed
Release:  * dev Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 18 May 2013 08:23:25 PM UTC, comment #1: 

I checked in the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/d3619d4d267c

John W. Eaton <jwe>
Group administrator
Fri 10 May 2013 09:32:50 AM UTC, original submission:  

Tested with MXE build of 3.7.3. Works as expected with 3.6.4 (on mingw32-i686) and 3.4.3 (on x86_64-unknown-linux-gnu).

Octave returns an error while parsing a function handle which returns a string expression. I am using feval only to demonstrate the expected result. The parse error also triggers for @()'foo' by itself.

  • Expected result:


> feval(@()'foo', {})

ans = foo

  • Actual result:


> feval(@()'foo', {})

parse error:

  syntax error

>>> feval(@()'foo', {})



A workaround is to use @()x='foo':

> feval(@()x='foo', {})

ans = foo

For types other than String Octave behaves as expected:

> feval(@()1:10, {})

ans =

    1    2    3    4    5    6    7    8    9   10

> feval(@()struct('a',5), {})

ans =

  scalar structure containing the fields:

    a =  5

Clemens Buchacher <drizzd>

 

(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 drizzd (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-05-18 jwe StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code