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

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

[Octave-bug-tracker] [bug #51820] OO: default values invoking constructo


From: Ernst Reissner
Subject: [Octave-bug-tracker] [bug #51820] OO: default values invoking constructor without arguments.
Date: Tue, 22 Aug 2017 10:36:42 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0

URL:
  <http://savannah.gnu.org/bugs/?51820>

                 Summary: OO: default values invoking constructor without
arguments. 
                 Project: GNU Octave
            Submitted by: ernstreissner
            Submitted on: Tue 22 Aug 2017 02:36:41 PM UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:


I have written a (legacy) class implementing arithmetics in java, called pn 
for polymorphic number. 

have a look at 
https://www.mathworks.com/help/matlab/matlab_oop/class-constructor-methods.html#btn2kiy,

to be more precise to the guidelines 
talking about constructors without arguments. 
This refers to 
++
When creating or expanding an object array such that not all elements are
given specific values, the class constructor is called with no arguments to
fill in unspecified elements
--

This is true even outside oo: 
a(5)=1 on unkown a performs padding a(1)...a(4) 
with default value 0. 
Consequently, 
a(5)=pn(1) performs padding a(1)...a(4) 
with default value pn() which represents 0 also in my case. 

Unlike prior releases, now pn() does not get invoked. 
Instead some raw constructor seems to be invoked, 
merely applying function class(...) 
but not providing a sensible default value. 






    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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