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

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

[Octave-bug-tracker] [bug #46397] eval: The evaluated code should not af


From: Ceral Paquet
Subject: [Octave-bug-tracker] [bug #46397] eval: The evaluated code should not affect last result
Date: Tue, 20 Mar 2018 10:05:54 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0

Follow-up Comment #4, bug #46397 (project octave):

Just for some clarity on eval behaviour differences.

MATLAB
++
>> clear; eval('12;'); % result: ans=12
>> clear; eval('x=12;'); % result: x=12 ans=not exist
>> clear; y=eval('12;'); % result: y=12 ans=not exist
>> clear; y=eval('x=12;'); % result: Error: The expression to the left of the
equals sign is not a valid target for an assignment.
--

Octave
++
>> clear; eval('12;'); % result: ans=12
>> clear; eval('x=12;'); % result: x=12 ans=not exist
>> clear; y=eval('12;'); % result: y=12 ans=12
>> clear; y=eval('x=12;'); % result: y=12 x=12 ans=not exist
--

It's not clear to me why Octave's behaviour is superior enough that is worth
making an incompatibility. 

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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