List Info

Thread: Case-sensitive behavior of clone?




Case-sensitive behavior of clone?
user name
2006-05-23 06:48:01

> An identifier beginning with a capital character and immediatel
> following it is an assignment operator (:=) is transformed into the 
> message "setSlotWithType" which acts just like setSlot but also 
> sets the type slot on the object before returning it. It is more a 
> way of avoiding having to write out an explicit type slot. This is 
> infact, the most common way identifiers are named. Capitalize
> camel case names are for protos, lower case identifiers for others.

Ahh- that's what I read- though I am fairly sure the proto VS 
instance capitalization was represented as just a stylistic 
convention, and not an actual behavior-differentiating syntax.

> If you do not wish a type slot to be set on an identifier you want 
> capitalized, just do this:
>;
> A := Object clone do(removeSlot("type"))
>
>; or
>
> setSlot("A", Object clone)
>
> This will remove the type slot, and return that very same object 
> (that is the behaviour of do()). As I say though, the times you'd ;
> want no type slot with a capitalized identifier are much less than 
> those when you would.

I suppose I will now have to go read exactly what the "type" slot is 
for- and why I would want one or not.
In my mind, I saw no need for a "type" slot- an object's type able to 
be inferred by it's protos.

-SS
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )