[2794] in java-interest

home help back first fref pref prev next nref lref last post

Re: Request for a small change in Object Wrapper Classes, like Float

daemon@ATHENA.MIT.EDU (Arthur van Hoff)
Fri Oct 13 19:58:36 1995

Date: Fri, 13 Oct 1995 14:45:07 -0700
From: Arthur.Vanhoff@Eng.Sun.COM (Arthur van Hoff)
To: andruid@SLINKY.CS.NYU.EDU
Cc: java-interest@java.Eng.Sun.COM


Hi Andruid,

> I was glad when i saw that Java has the capability to treat simple
> data as first class objects.  However, upon close inspection, i am
> very surprised to learn that such objects, are ... well, they're sort
> of 2nd class, actually.  This is to say, that i can create such an
> object, and i can then access its value, and get that value converted
> in various ways, and send it messages, caused its subclassed on
> Object.  What i can't do is change the value of this slot!  To
> implement a set(float newValue) method is, of course, for the creator
> of the Float class (and its sisters), trivial.  This
> would make it much easier for us to do meta-manipulations on data
> slots!  Is there some reason why this would be a bad idea?

There is another line of reasoning where it is desirable for these
objects to be immutable. This makes them useful as indexes into hashtables
etc. Making them mutable will introduce a host of other problems.

Have fun,

	Arthur van Hoff
	
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post