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

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

[Octave-bug-tracker] [bug #51801] OO: constructor without arguments


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

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

@mike 
you ask what i suggest: 
We read in the manual: 
++
Ideally, even when the constructor is called with no arguments 
it should return a valid object. 
--

We should say why: 

Ideally, even when the constructor is called with no arguments 
it should return a valid object 
because octave invokes the constructor with no arguments 
to determine the default value. 

https://www.mathworks.com/help/matlab/matlab_oop/class-constructor-methods.html

The default value is used for padding values into an array. 
If you write a(5)=1 where a is undefined, 
a(1),...,a(4) are padded with the default value which is 0. 

Accordingly, if you have a class say pn which allows argument 1 
and if you write a(5)=1 where a is undefined, 
a(1),...,a(4) are padded with the default value 
which is determined invoking pn(). 


What is strange: in the newest release, octave does no longer invoke pn() 4
times as it used to do. 
So i ask myself how it determines the default value. 

Is there another bug here???

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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