[Top][All Lists]

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

[Octave-bug-tracker] [bug #29447] Cannot create @handles to non-existing

From: Judd Storrs
Subject: [Octave-bug-tracker] [bug #29447] Cannot create @handles to non-existing functions
Date: Tue, 06 Apr 2010 16:29:14 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100214 Ubuntu/9.10 (karmic) Firefox/3.5.8

Follow-up Comment #3, bug #29447 (project octave):

Here's a slightly different idea--if the handle is invalid print a warning
and return the function name as a string instead.

diff -r 6cf7d7665d57 src/ov-fcn-handle.cc
--- a/src/ov-fcn-handle.cc      Fri Apr 02 13:08:11 2010 -0400
+++ b/src/ov-fcn-handle.cc      Tue Apr 06 12:23:50 2010 -0400
@@ -1523,7 +1523,10 @@
-        error ("@%s: no function and no method found", tnm.c_str ());
+        {
+          warning ("@%s: no function and no method found", tnm.c_str ());
+          retval = tnm;
+        }
   return retval;

I'm not sure that I did the octave_value string creation correctly or if I
need to add something for memory management. "make check" is the same with and
without the change (all pass except for one eigs failure). 

This is how octave behaves with the change, which seems reasonable to me:

octave:1> func = @crash
warning: @crash: no function and no method found
func = crash
octave:2> typeinfo func
ans = sq_string
octave:3> feval(func)
error: feval: function `crash' not found

If this approach is acceptable I can create a changeset.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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