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

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

[Octave-bug-tracker] [bug #59500] sub-classes of octave_base_value aren'


From: Rik
Subject: [Octave-bug-tracker] [bug #59500] sub-classes of octave_base_value aren't assignable
Date: Mon, 23 Nov 2020 11:43:38 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36

Update of bug #59500 (project octave):

                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up Comment #2:

I think this is an unintended side effect of internal code re-organization.  I
can't see any reason why it should not be possible to declare two
octave_scalar variables and then assign one to the other.  It does seem to me
like that requires fixing.

However, I don't think it's a good idea to rely on the form of Octave
internals for higher performance, as the internals may change at any time.  I
would advise coding to the API as that can be relied on between versions (5.2
to 6.1 for example).  When a change is going to be made to the API, we
announce it and preserve functionality for two versions of Octave so that
there is sufficient time to change code before it becomes broken code.

In the example you posted, isn't it enough to declare an octave_scalar ahead
of the for loop and then re-use it rather than creating a temporary every
time?


octave_scalar x (0.0);
octave_value_list lst = ovl (x);

for (int i = 0; i < 1000000; i++)
  {
    x = double(i);
    myfunction (lst);
  }


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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