[Grace-core] On numbers and objects

James Noble kjx at ecs.vuw.ac.nz
Tue Nov 9 17:16:42 PST 2010


> I think all objects that have literals (Boolean, Number, String)  
> cannot have constructors. These objects pre-exist, and literals are  
> provided as constant references to those objects.

That seems OK for those three. The catch is that we hope to have
literals for things like Arrays or Lists - but will want to have  
"constructors"
for them too (I think!).  We'll also have something like "object  
literals"
(aka object construction expressions) but they (currently) don't have
constructors

> Objects that have constructors cannot have literals.


the catch there is we may want constructor *calls* that don't end up
creating a new object.  Hmm: perhaps I'm making more of a fuss about
this than I need to - our current plans mean that things like "class  
methods"
don't necessarily end up constructing and object anyway. Perhaps we can
incorporate that somehow into the design for immutable objects.

James


More information about the Grace-core mailing list