Re: Adding const to java

"Onder Karpat" <onderkarpat@yahoo.com>
6 Nov 2002 11:38:49 -0500

          From comp.compilers

Related articles
Adding const to java lashari@hotmail.com (Ghulam Lashari) (2002-10-24)
Re: Adding const to java onderkarpat@yahoo.com (Onder Karpat) (2002-11-06)
Re: Adding const to java joachim_d@gmx.de (Joachim Durchholz) (2002-11-06)
Re: Adding const to java titzer@expert.ics.purdue.edu (Ben L. Titzer) (2002-11-06)
Re: Adding const to java hagge@isde.uni-hannover.de (Nils Hagge) (2002-11-06)
Re: Adding const to java C.vanReeuwijk@twi.tudelft.nl (Kees van Reeuwijk) (2002-11-06)
| List of all articles for this month |

From: "Onder Karpat" <onderkarpat@yahoo.com>
Newsgroups: comp.compilers
Date: 6 Nov 2002 11:38:49 -0500
Organization: Compilers Central
References: 02-10-101
Keywords: Java, design
Posted-Date: 06 Nov 2002 11:38:49 EST

Hi,


Constant modifier is helpful in determining pure
functions i.e. call with the same arguments are always
results in the same value. So compiler can remove
later calls in the context and use the first one's
results.


a = f.const_p();
b = f.const_p(); // can be safely replaced by b = a


However it is not always helpful if arguments may be
modified in the function. But they have a high
potential.


Oender


>I have implemented "const" modifier in Java
>Programming Language. The
>semantics of const are similar to that of C++. I am
>trying to experiment if
>there is any usefulness of this modifier for example
>in gc etc. I am looking
>for some opinions/suggestions here about what domains
>of the usefulness of
>this modifier can/should be explored (for example in
>Virtual Machine runtime).


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.