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

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

[Octave-bug-tracker] [bug #56385] operations don't compose


From: anonymous
Subject: [Octave-bug-tracker] [bug #56385] operations don't compose
Date: Fri, 24 May 2019 19:04:56 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0

URL:
  <https://savannah.gnu.org/bugs/?56385>

                 Summary: operations don't compose
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Fri 24 May 2019 11:04:55 PM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Regression
                  Status: None
             Assigned to: None
         Originator Name: JD
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 5.1.0
        Operating System: GNU/Linux

    _______________________________________________________

Details:

When working with the very simple class 'MyFavoriteDouble' (c.f.
https://github.com/jdbancal/MyFavoriteDouble ) the following happens:


GNU Octave, version 5.1.0
Copyright (C) 2019 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at https://www.octave.org.

Please contribute if you find this software useful.
For more information, visit https://www.octave.org/get-involved.html

Read https://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

octave:1> a=myFavDouble(1)
 
a = 
 
1.000000
 
octave:2> b=myFavDouble(2)
 
b = 
 
2.000000
 
octave:3> c=a+b
 
c = 
 
3.000000
 
octave:4> d=plus(a,b)
 
d = 
 
3.000000
 
octave:5> e=plus(myFavDouble(1), myFavDouble(2))
error: value on right hand side of assignment is undefined
octave:5> 


Clearly:
* the class 'myFavDouble' is well defined (it is a very simple classdef) and
its constructor works well and produces a result
* the function 'plus' works and produces a result
* but it is not possible to combine both functions in one shot: octave
complains that he receives nothing from 'plus(myFavDouble(1), myFavDouble(2))'
to assign to the variable 'e'. What we would expect here is to get the output
"d=3.000000" instead of an error.

This constitutes a regression because it works seemlessly on Octave 4.2.2 (but
already not anymore on Octave 4.4.1, haven't tested 4.4.0). It also
constitutes a incompatibility with matlab, because matlab doesn't have this
problem (even on the latest versions; tested on matlab 2018b).

To reproduce this bug, download the above code, type `mex MyFavDouble_mex` in
Octave, and you are ready to test the above commands.




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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