Allen Wirfs-Brock wrote:
On Jul 22, 2013, at 6:30 PM, Brendan Eich wrote:

Allen Wirfs-Brock wrote:
...
I agree that int64(x)  is nice for int64 (although I would expect such scalar 
values to me immutable regardless of how you create them).
The intuition (supported by other languages) is that 'new' heap-allocates 
something mutable by default. Stack allocation and (implicit or not) coercion 
does not. C++ is not far from the mark here, but IIRC C# is similar.


pretty much agree, except for the mutable part.  There is no reason that a heap 
allocated entity can't be immutable, by default  if it is appropriate for the 
abstraction.

Ok, but you are picking a nit.

  Similar,it is certainly possible to design a language with stack allocated 
mutable structs.

Let's not.

On the heap-allocated immutable bit, you'd need to say something extra to "opt in". That's JS!

/be
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to