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

[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: Wed, 07 Apr 2010 14:58:08 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100214 Ubuntu/9.10 (karmic) Firefox/3.5.8

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

"At the time you create a function handle, the function you specify must be
on the MATLAB path and in the current scope of the code creating the handle."

...doesn't actually say it is an _error_ to create an invalid handle. It
could be saying that the handle won't work.

I think there are two issues that are being discussed here:

0 Do we allow invalid handles to be created?
0 Do we allow invalid handles to possibly be repaired when they are used?

With respect to the first, I think the permissiveness of allowing creation of
an invalid handle but making it an error to use an invalid handle an error is
consistent with the language as a whole. 

The criticism that handles can result from typos is a valid concern. However,
I don't think that error() is fundamentally superior to warning() for
notifying the user of the possible typo. The latest patch I posted issues
warnings on creation of invalid handles and errors on use. 

Is an error at creation better than a warning? The Matlab debugger can be
configured break on warnings. I don't know if it's currently possible to
switch the octave interpreter into an mode that treats all warnings as errors.
I think that in itself would be useful. But it is a different issue.

[ Just as a philosophical aside, in these interactive numerical languages
there was a similar debate about whether or not to allow empty matrices and
one argument against having empty matrices is that an empty matrix can never
be indexed--so don't even let the user have the option of creating an empty
matrix. Anyway, Matlab decided to allow empty matrices and issue an error when
indexing the empty matrix, but IDL forbade them instead. ]

With respect to the second point--whether to repair a broken handle, I think
the quote from the documentation is not ambiguous in you should probably not
expect invalid handles to be repaired.

    _______________________________________________________

Reply to this item at:

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

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





reply via email to

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