RE: [sv-ec] Constant class methods

From: Mirek Forczek <mirekf_at_.....>
Date: Wed Apr 02 2008 - 01:57:27 PDT
Indeed, having 'const' attribute on method would result in treating the
implicit 'this' argument as constant one. That's what would happen within
scope of the method body.

But the 'const' attribute on method would have also impact on semantics
outside the method body:

- clearly denote the method's nature (documentation),
- provide semantics to allow (const) method calls in special contexts (i.e.
assertion formula),
- provide input for compiler to enable potential code optimizations.

Regards,
Mirek

-----Original Message-----
From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org] On
Behalf Of Steven Sharp
Sent: 2 kwietnia 2008 02:39
To: sv-ec@server.eda.org; danielm@aldec.com.pl
Subject: Re: [sv-ec] Constant class methods


>From: "danielm" <danielm@aldec.com.pl>

>IMHO SV should itroduce constant modifier to class methods (functions, 
>and task). This feature is widely used in other languages - ie in C++.
>Such modifier should forbid to modify class properties referenced. 
>It would be very usefull to know that certain function do not modifies 
>the object on which it is called.

Is this equivalent to treating the implicit 'this' argument as const?

Steven Sharp
sharp@cadence.com


--
This message has been scanned for viruses and dangerous content by
MailScanner, 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 Wed Apr 2 01:58:25 2008

This archive was generated by hypermail 2.1.8 : Wed Apr 02 2008 - 01:59:05 PDT