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

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

[Octave-bug-tracker] [bug #57255] "+=" in anonymous function within cell


From: Rik
Subject: [Octave-bug-tracker] [bug #57255] "+=" in anonymous function within cell array context should emit an error
Date: Thu, 21 Nov 2019 14:49:50 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #8, bug #57255 (project octave):

I suppose that's fine.  It's odd to me that my second example,


clear all
counter = @() {x += 1 ; }


produces the error about use of an operator in an anonymous function when, in
fact, the problem is that x is undefined.  Whereas,


clear all
counter = @() x += 1;


produces only a syntax error.

If it was trivial to fix, I would have them both do the same thing.

Also, just presenting the interpreter with


clear all
x += 1
error: 'x' undefined near line 1, column 1


gives a more meaningful error message.  Is it possible to throw the message
from the underlying parse error rather than just "syntax error"?



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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