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

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

[Octave-bug-tracker] [bug #38958] parse error in function handle returni


From: Clemens Buchacher
Subject: [Octave-bug-tracker] [bug #38958] parse error in function handle returning string expression
Date: Fri, 10 May 2013 09:32:52 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0

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

                 Summary: parse error in function handle returning string
expression
                 Project: GNU Octave
            Submitted by: drizzd
            Submitted on: Fri 10 May 2013 09:32:50 AM GMT
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Regression
                  Status: None
             Assigned to: None
         Originator Name: Clemens Buchacher
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

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




    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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