Slots in layers, was Re: [closer-devel] ContextL design question...
Pascal Costanza
pc at p-cos.net
Tue Feb 28 15:59:10 UTC 2006
On 28 Feb 2006, at 10:59, Nick Bourner wrote:
> Oops, sorry for the confusion. I was referring to the code in your
> original post for defining slots in layers which were inherited by
> sublayers.
>
> I think the example was
>
> (deflayer output ()
> ((grouped-layer-root :initform 'output .....
>
> etc.
Ah, ok. You can already do this by using undocumented behavior. So
for examlpe, it should be possible to say this:
(deflayer some-layer ()
((some-slot :initform 42 :allocation :class :reader some-slot)))
...and then access the slot like this:
(some-slot (layer-prototype (find-layer 'some-layer)))
[Untested!]
My goal is to make this look less ugly, but the semantics will be
more or less the same. (This is all a side effect of the fact that
layers are internally implemented as classes.)
> I still haven't completely thought through what we were talking about
> at DLD, and for the most part, it may not be necessary now. But I'll
> try to come up with a concrete example.
OK, would be nice. (But don't worry too much...)
Cheers,
Pascal
>
> Cheers,
> Nick
>
>
> On 2/28/06, Pascal Costanza <pc at p-cos.net> wrote:
>>
>> On 27 Feb 2006, at 19:10, Nick Bourner wrote:
>>
>>> Hi Pascal,
>>>
>>> I have to agree with your opinion that the prototype-based
>>> approach is
>>> the one to go for. I think that moving to a class-based approach
>>> adds
>>> far too much complexity for minimal or no real gain in usefulness or
>>> expressiveness. In my opinion that would be unfortunate, because for
>>> me one of the strengths of ContextL is that it provides a
>>> conceptually
>>> simple, but very powerful, abstraction that can be used to simplify
>>> the organisation and expression of application code. Making the
>>> abstraction more complex somewhat defeats the object - if you're not
>>> careful you could wind up with application code that's as complex as
>>> it would have been without the layering.
>>
>> Thanks a lot for your feedback!
>>
>>> BTW - is the code for slots in layers available? I could really use
>>> that about now :-)
>>
>> Hmm, could you explain to me again what it is that you want here - I
>> only have a rough idea from our discussion at the Dynamic Languages
>> Day, but it would be helpful if you try to describe again what
>> problem you actually want to solve. I hope I can then find a
>> solution...
>>
>>
>> Cheers,
>> Pascal
>>
>> --
>> Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
>> Vrije Universiteit Brussel, Programming Technology Lab
>> Pleinlaan 2, B-1050 Brussel, Belgium
>>
>>
>>
>>
>>
>
--
Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
Vrije Universiteit Brussel, Programming Technology Lab
Pleinlaan 2, B-1050 Brussel, Belgium
More information about the closer-devel
mailing list