Re: Adding const to java

"Onder Karpat" <>
6 Nov 2002 11:38:49 -0500

          From comp.compilers

Related articles
Adding const to java (Ghulam Lashari) (2002-10-24)
Re: Adding const to java (Onder Karpat) (2002-11-06)
Re: Adding const to java (Joachim Durchholz) (2002-11-06)
Re: Adding const to java (Ben L. Titzer) (2002-11-06)
Re: Adding const to java (Nils Hagge) (2002-11-06)
Re: Adding const to java (Kees van Reeuwijk) (2002-11-06)
| List of all articles for this month |

From: "Onder Karpat" <>
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


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

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


>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.