From: Robert Klemme Date: 2007-10-05T17:38:56+09:00 Subject: Re: Reference vs. Reference 2007/10/5, Robert Dober : > On 10/5/07, Rick DeNatale wrote: > > > Part of the problem with this whole discussion is that it's crossing > > meta-levels. Immediates/intrinsics exist in the implementation, below > > the language level. To the Java/Smalltalk/Ruby programmer the > > encoding of object references is invisible. Object references are > > object references. > Not for Java - we can not accept Java in the same league as Smalltalk > and Ruby can we ? ;). Um, where's the problem? Java is a great language and it certainly has its uses (helps to pay my bills for example). And don't forget that several pieces of Ruby were inspired by Java (at least I believe so). > While in Smalltalk and Ruby I can and shall handle a Fixnum as an > imutable object > in Java I cannot. > IIRC this fact is somehow hidden in version 1.5+ by some mechanism of > Autoboxing but I am not sure about that. Immutability and PODs with autoboxing are different concepts. In all Java versions (i.e. even prior to 1.5) java.lang.Integer and similar /are/ immutable. In fact, with regard to calling semantics this is the exact equivalent to Ruby. From a Ruby language user's perspective immediate values are just an internal optimization that is irrelevant for parameter passing modes. Rick nicely pointed this out. Kind regards robert