[sv-ec] RE: id 185, svdb 2342 static constructor

From: Rich, Dave <Dave_Rich_at_.....>
Date: Thu May 07 2009 - 00:52:40 PDT
Hi Arturo,

 

I agree that a constructor is semantically a static function, but not
syntactically. 

 

If we don't restrict the syntactic form of a static constructor, I would
claim that there is nothing in the LRM prohibiting the forms that I
mention. BTW, the last statement was a shallow copy.

 

The only reason I can think one would want to explicitly declare a
constructor as static was so that it could be referenced like any other
static function.

 

I can go either way on this.

 

Dave

 

 

________________________________

From: Arturo Salz [mailto:Arturo.Salz@synopsys.com] 
Sent: Wednesday, May 06, 2009 11:31 PM
To: Rich, Dave; Arturo Salz; Mehdi Mohtashemi; sv-ec@eda.org
Subject: RE: id 185, svdb 2342 static constructor

 

I'm not sure that allowing explicitly declared static constructors would
enable (or their lack disable) the forms you envision. The truth is that
constructor are already somewhat like static methods - they are not
called using a handle.

 

As far as the forms you list, I believe they don't all (yet) exist, but
they would be a nice addition (I believe Steve Sharp had proposed
something along these lines in the past). BTW, I understand they first
two a = B::new(); and b = new(); - I don't know what the last one is
supposed to be. But particularly, a = B::new(); would be a very nice
addition to the language - as would be return-type covariant method
overrides. But I guess we have to leave something for the future.

 

            Arturo

 

From: Rich, Dave [mailto:Dave_Rich@mentor.com] 
Sent: Wednesday, May 06, 2009 11:12 PM
To: Arturo Salz; Mehdi Mohtashemi; sv-ec@eda.org
Subject: id 185, svdb 2342 static constructor

 

 

id 185, svdb 2342    _____ YES   __X__ No

http://www.eda.org/svdb/view.php?id=2342  

 

I only object to the limitation that the constructor may not be static
-why not? And, would there be a semantically observable difference
between a static versus a non-static constructor? I don't believe there
is such a difference. I will change my vote to yes if that limitation is
removed.

 

[DR] Would allowing an explicitly declared static constructor open up
the door for static method references?

 

class A; endclass;

class B extends a; endclass

 

A a

B b;

 

a = B::new();

 

b = new();

 

a = A::new b;

 

 

Or do these forms already exist?

 

Dave

 

 

 

 

 

 


-- 
This message has been scanned for viruses and 
dangerous content by MailScanner <http://www.mailscanner.info/> , and is

believed to be clean. 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu May 7 00:55:47 2009

This archive was generated by hypermail 2.1.8 : Thu May 07 2009 - 00:56:44 PDT