From pc at p-cos.net Thu Jul 2 12:19:45 2009 From: pc at p-cos.net (Pascal Costanza) Date: Thu, 2 Jul 2009 14:19:45 +0200 Subject: [closer-devel] LAYER-NAME vs LAYER in ADJOIN-LAYER/REMOVE-LAYER. In-Reply-To: References: Message-ID: <1F8131BA-C4B4-4843-ADD1-2C0DBC07C85B@p-cos.net> Hi there, Sorry for the late reply, we're pretty busy around here with some last project proposal writing before the summer holidays. I understand your concern, and the suggested fix certainly makes it work. However, it's not so nice, because this will needlessly increases the cache sizes, because every named layer may end up twice in the caches, once based on the names, and once based on the metaobjects. I see two ways out: Either I use the metaobjects everywhere, and use the names only for the user-level macros (which expand into code that converts the names into metaobjects as soon as possible. Or I make sure that anonymous layers have unique names as well: At the moment, their names are 'nil, but I could use the metaobjects themselves as 'names'. (For example, (layer-name #) => #. The first option may conceptually be cleaner, but requires more work and may potentially break some existing code (not sure about the last point, but my gut feeling tells me that there are some potentially problematic corner cases waiting for me if I go down that path). The second option is relatively easy to do. It may still require a couple of changes here and there, but I don't expect any serious problems. Somehow, I prefer that you can use the layer names in the functional API (adjoin-layer, remove-layer, ensure-active-layer, and friends). Does anybody have any strong opinions about this? Anyway, thanks a lot for raising this issue, I wouldn't have noticed that problem otherwise. The ContextL MOP is the least polished part of ContextL, so such feedback is especially useful. May I ask what you are actually using this for? (I like abuses of language constructs, this usually gives hints for new ideas for missing features...) Best, Pascal On 24 Jun 2009, at 18:06, Drew Crampsie wrote: > Hello, > > I'm sure i'm abusing contextl in some way (anonymous layers that > themselves are layered classes), but for my code to work the call to > ADJOIN-LAYER in REMOVE-LAYER-USING-CLASS must pass the layer directly > to ADJOIN-LAYER, not indirect through the layer name. > > In other words : > > hunk ./cx-layer.lisp 103 > - (layer-name active-layer) > + active-layer > > This works for me and passes all the tests, but i'm not sure if it's > the right thing to do... i'm likely abusing contextl in many ways ;). > > Cheers, > > drewc > > _______________________________________________ > closer-devel mailing list > closer-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/closer-devel -- Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net Vrije Universiteit Brussel Software Languages Lab Pleinlaan 2, B-1050 Brussel, Belgium