MASON-INTEREST-L Archives

October 2009

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Sean Luke <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Thu, 29 Oct 2009 18:27:29 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (28 lines)
On Oct 29, 2009, at 6:18 PM, glen e. p. ropella wrote:

> The point being, if you want to make the two things adhere to the same
> interface, then why are they different classes? Is it solely for
> efficiency? Are there separate (functional requirement based) use
> cases
> for mutables than for immutables? Etc.

It's always been efficiency.

It's not uncommon either: for example, Obj-C has immutable and mutable
versions of all of its basic data types.

Double2D is obviously the primary though, because its immutability
means it doesn't break Java's hash tables (unlike say, the mutable
java.awt.Point2D).

This is less of an issue with more efficient handling of allocations
of small short-lived objects in Java, which is a priority for Sun now
that all the boxing and unboxing is going on (ugh). But it's still
slower.

My goal then has been to try to make the Mutable classes *reasonably*
compatible with the immutable classes without causing lots of
confusion among people.

Sean

ATOM RSS1 RSS2