About KCP and automatic initialize

Andreas Raab andreas.raab at gmx.de
Tue Sep 16 15:28:39 UTC 2003


Hi Stephen,

Just briefly: I really like this proposal as it gets into an area where we
look at an "exemplar" for some class rather than the class itself. This is
very much along the lines of E where (for example) you define an _object_
rather than a class if you write something like:

def pointMaker(x,y) : any {
	def point {
		to getX(): any {x}
		to getY(): any {y}
	}
}

"point" in the above is not a class but rather an object which responds to
the #getX and #getY message.

Cheers,
  - Andreas

> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org 
> [mailto:squeak-dev-bounces at lists.squeakfoundation.org] On 
> Behalf Of Stephen Pair
> Sent: Tuesday, September 16, 2003 5:04 PM
> To: The general-purpose Squeak developers list
> Subject: Re: About KCP and automatic initialize
> 
> 
> Sorry if this has already been suggested (I haven't been able 
> to keep up 
> with this thread), but what about having a prototypical instance 
> associated with each class?  New instance creation would happen by 
> cloning that prototypical instance (which would already have its  
> instance variables defaulted to whatever is required).  Further 
> initialization that needs to happen on an instance by instance basis 
> could happen by overridding the #clone method (or some other 
> clone-like 
> method used for instance creation).  Of course, this wouldn't 
> work for 
> variably sized object, but you could probably fake it in some way.
> 
> - Stephen
> 
> 



More information about the Squeak-dev mailing list