Slot semantics

Brian Rice water at tunes.org
Sun Jan 9 21:04:31 PST 2005


On Jan 9, 2005, at 8:38 PM, Shaping wrote:

> I want to be certain that I undestand this:
>
> addSlot: #SDLLib.
> SDLLib addSlot: #libSDL valued: (ExternalLibrary newNamed: 'SDL').
>
> It seems to be defining slot #SDLLib, which points to yet another slot 
> #libSDL, which points to an ExternalLibrary object on the heap.  Is 
> this correct?  Is so, why would we want this indirection?

Most likely in this situation it is entirely redundant, but I have not 
scrutinized that code yet (since it seems he is still discovering basic 
idioms and how to write clean Slate code).

Most likely the "redundancy" is just the library author's lack of 
clarity in terminology. A possible clean-up would be to mirror what 
src/ui/X11/port.slate defines: lobby -> ports -> SDL -> libHandle -> 
(ExternalLibrary newNamed: 'SDL'). The "port" abstraction is a 
swappable UI implementation for input and rendering, at least in 
principle (CLIM already does this and we are moving forward from the 
CLIM design).

--
Brian T. Rice
LOGOS Research and Development
http://tunes.org/~water/




More information about the Slate mailing list