Christopher Oliver wrote:
-----Original Message----- From: Sylvain Wallez
[mailto:[EMAIL PROTECTED] Sent: Friday, March 21, 2003
11:28 AM To: [EMAIL PROTECTED] Subject: Re: Problem with
JPetStore

Christopher says that Rhino makes no difference between "object"
types and primitive types. Now if we consider primitive types as
being represented like the immutable objectified Java primitive types
 (Integer, Boolean, etc), there's not much difference between passing
an immutable object by reference and a real primitive type by value.

But that's nitcpicking ;-)


Warning: More nitpicking coming:


If you want the "proper" semantics, you have to say "inmutable and using the flyweight pattern for instantiation". This is to preserve object identity. I.E. two Integer(1) objets must be equals() and also identical(==)

This behaviour is similar to interned ("<astring>".intern() ) Strings in java, AKA symbols in lisp.

In lisp and Smalltalk this distinction has bitten me a few times. :-)


Sylvain

JavaScript primitives are immutable objects. So I think "passing an
immutable object by reference" is the correct description. But I
didn't say that there are no differences between "object" types and
primitive types in JavaScript. What I said is that there is no
difference in how they are shared between continuations.

Regards,

Chris


--
Santiago Gala
High Sierra Technology, S.L. (http://hisitech.com)
http://memojo.com?page=SantiagoGalaBlog




Reply via email to