|
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 |
URL: <http://savannah.gnu.org/bugs/?51586> 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 _______________________________________________________ Details: Although in general creating a function handle fails using the @Class/Method syntax the str2func('@Class/Method') 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 <http://savannah.gnu.org/bugs/download.php?file_id=41353> _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?51586> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |