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

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

[Octave-bug-tracker] [bug #61842] New "too many inputs" error message wr


From: Rik
Subject: [Octave-bug-tracker] [bug #61842] New "too many inputs" error message wrong with anonymous functions
Date: Mon, 17 Jan 2022 12:23:42 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36

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

Just for reference, here is what Octave does when error() is used (rather than
an error detected by parser)


myfunc = @() error ("abc")
myfunc =

@() error ("abc")

octave:2> myfunc()
error: abc
error: called from
    @<anonymous> at line 1 column 14


So at least in terms of debugging functions like `dbstack` Octave uses
"@<anonymous>" to refer to an anonymous function.  Hence, I think the patch in
comment #2 is probably good.

As an improvement in the future, it might be nice if Octave could return the
name of the variable that holds the anonymous function because that will be
more useful to the programmer if, for example, they have defined 10 different
anonymous functions and need to determine which one is at fault.  But, this
could be made a wishlist item.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61842>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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