Re: there is a subtle problem doing: mySlot := obj getSlot(slotname)

Jeremy Tregunna <[email protected]> Tue, 08 Nov 2011 11:00:40 -0600
Newsgroups gmane.comp.lang.io
Message-ID <[email protected]>
On 2011-11-08, at 10:42 AM, Jan-Paul Bultmann wrote:

> 
> Our metas and proxy stuff was also only for activatables :)
> 
> Maybe we can do that as an optimization for metas?
> Jer why dont we implement them and see what we can optimize and inline.

Well, they're implemented in the acute prototype.

> And metas will be worth it for further concepts like permissions and contracts. (typing)

Well, since metas are object-specific meta data as they relate to another object (glue between a receiver, and one of its slot values), using them for typing is really a bad idea.

A better idea for typing would be to build your type out of the slots/traits an object responds to. One mechanism you can do is to generate a unique id of some sort (keep in mind dependency problems if you use a real object), that you can assign in a known position, say __type slot of an object. During lookup, you check for this type, and if it doesn't exist, create one. You'd generate this type from the complete set of slots and protos. I hesitate to include the activatable bit as part of that calculation, because it doesn't really change the object, just changes what happens during blocks being called by name which doesn't really affect the type at all.

From there, you only need a hook into setSlot/updateSlot which fires off an incremental update, to feedback the type of an object into the system when a change occurs. 

That's how I'd approach the basic fundamentals of a type feedback system in Io, and more importantly, how I'd generate types.
> 

Regards,

Jeremy Tregunna