[Top][All Lists]

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

[Octave-bug-tracker] [bug #51586] Creating method handle fails using str

From: Piotr Held
Subject: [Octave-bug-tracker] [bug #51586] Creating method handle fails using str2func
Date: Wed, 26 Jul 2017 20:07:48 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36


                 Summary: Creating method handle fails using str2func
                 Project: GNU Octave
            Submitted by: jsoh425
            Submitted on: Thu 27 Jul 2017 12:07:47 AM UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Regression
                  Status: None
             Assigned to: None
         Originator Name: Piotr Held
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any



Although in general creating a function handle fails using the @Class/Method
syntax the 


still worked as of Octave 4.0.3. 

The fix to this seems to be a one-line check. Basically str2func assumes that
is the string starts with '@' that means it is a anonymous function. Checking
if the next non-whitespace symbol is '(' is can be used for disambiguation of
the two cases.

I am attaching a test case that passes on 4.0.3.

In the next comment I will attach my patch.


File Attachments:

Date: Thu 27 Jul 2017 12:07:47 AM UTC  Name: creating_method_handle.m  Size:
222B   By: jsoh425
Test case for the problem


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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