From pc at p-cos.net Sat Oct 14 11:43:42 2006 From: pc at p-cos.net (Pascal Costanza) Date: Sat, 14 Oct 2006 13:43:42 +0200 Subject: [closer-devel] Support for LispWorks 5.0 Message-ID: Hi, I have just added Closer to MOP support for LispWorks 5.0 to the darcs repository. Before I make this part of the "official" release, I would like to wait a little to see if I get some bug reports. Since I have made the changes directly in the sources of the LispWorks Closer to MOP support, it could be that I have accidentally broken support for older LispWorks version - so feedback in this regard would also be useful. 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 From eBay at common-lisp.net Sat Oct 14 13:06:04 2006 From: eBay at common-lisp.net (eBay at common-lisp.net) Date: Sat, 14 Oct 2006 08:06:04 -0500 Subject: [closer-devel] New Unpaid Item Message from tany70 : #294653688662 Message-ID: <200610141306.k9ED64901605@lma627.siteprotect.com> An HTML attachment was scrubbed... URL: From pc at p-cos.net Thu Oct 19 15:08:56 2006 From: pc at p-cos.net (Pascal Costanza) Date: Thu, 19 Oct 2006 17:08:56 +0200 Subject: [closer-devel] Reflective Layer Activation in ContextL Message-ID: <39E7C30B-D0D8-4101-9675-554C92A2C350@p-cos.net> Hi everyone, We have got a paper accepted at the ACM Symposium on Applied Computing, track "Programming for Separation of Concerns." It describes the reflective layer of ContextL, a few examples, and implementation considerations, especially the fact that it doesn't have a negative impact on performance. We cannot make the paper publicly available yet, but if you're interested to get an advance copy, please contact me directly. We would actually appreciate some feedback on the paper. 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 From peter.denno at nist.gov Thu Oct 19 15:36:49 2006 From: peter.denno at nist.gov (Peter Denno) Date: Thu, 19 Oct 2006 11:36:49 -0400 Subject: [closer-devel] Reflective Layer Activation in ContextL In-Reply-To: <39E7C30B-D0D8-4101-9675-554C92A2C350@p-cos.net> References: <39E7C30B-D0D8-4101-9675-554C92A2C350@p-cos.net> Message-ID: <200610191136.49874.peter.denno@nist.gov> On Thursday 19 October 2006 11:08, Pascal Costanza wrote: > Hi everyone, > > We have got a paper accepted at the ACM Symposium on Applied > Computing, track "Programming for Separation of Concerns." It > describes the reflective layer of ContextL, a few examples, and > implementation considerations, especially the fact that it doesn't > have a negative impact on performance. > > We cannot make the paper publicly available yet, but if you're > interested to get an advance copy, please contact me directly. We > would actually appreciate some feedback on the paper. Hi, I'd very much like a copy of this (draft?) paper. I'll provide feedback. > > > Cheers, > Pascal -- Best Regards, - Peter Peter Denno National Institute of Standards and Technology, Manufacturing System Integration Division, 100 Bureau Drive, Mail Stop 8260 ? ? ? ? ? ? Tel: +1 301-975-3595 Gaithersburg, MD, USA 20899-8260 ? ? ? ? ?FAX: +1 301-975-4694 From gwking at metabang.com Thu Oct 19 17:49:31 2006 From: gwking at metabang.com (Gary King) Date: Thu, 19 Oct 2006 13:49:31 -0400 Subject: [closer-devel] Reflective Layer Activation in ContextL In-Reply-To: <39E7C30B-D0D8-4101-9675-554C92A2C350@p-cos.net> References: <39E7C30B-D0D8-4101-9675-554C92A2C350@p-cos.net> Message-ID: <1A7F6863-AE75-4B90-A272-5C9D261929AB@metabang.com> Hi Pascal, Congratulations. I'd love to see the paper. On Oct 19, 2006, at 11:08 AM, Pascal Costanza wrote: > Hi everyone, > > We have got a paper accepted at the ACM Symposium on Applied > Computing, track "Programming for Separation of Concerns." It > describes the reflective layer of ContextL, a few examples, and > implementation considerations, especially the fact that it doesn't > have a negative impact on performance. > > We cannot make the paper publicly available yet, but if you're > interested to get an advance copy, please contact me directly. We > would actually appreciate some feedback on the paper. > > > 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 > > > > > _______________________________________________ > closer-devel mailing list > closer-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/closer-devel -- Gary Warren King, metabang.com Cell: (413) 885 9127 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM From attila.lendvai at gmail.com Thu Oct 19 17:54:02 2006 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Thu, 19 Oct 2006 19:54:02 +0200 Subject: [closer-devel] Reflective Layer Activation in ContextL In-Reply-To: <123A3FE5-A890-449E-B893-E8BAEEE34BB9@p-cos.net> References: <39E7C30B-D0D8-4101-9675-554C92A2C350@p-cos.net> <123A3FE5-A890-449E-B893-E8BAEEE34BB9@p-cos.net> Message-ID: > i was also doing some _very_ quick and dirty performance measurements with > the new metacopy and indeed there was no significant difference between the > simple and the contextl version. > > > Good to know. It was more an accident that I happened to find a way to > implement this efficiently, but I also think this is important for general > acceptance. > i'm sure you know much more about these, but maybe you have not heard of Slate. in vague terms it's a lisp with smalltalk syntax where the atoms are objects (with prototype based multiple dispatch) not cons cells. (the most important addition of slate is that you dynamically annotate any object, no matter who created it, which will be a very important feature of future systems imho) (before the bootstrepping) there was 'subjective dispatch' in it. there was an implicit first and last argument for each function call, where the first was called layer and the last was called subject. after the bootstrap it was temporarily dropped because it made the method chaching and inlining much more difficult. unfortunately since then slate is an abandoned project. so why isn't there a 'subject' for contextl? not that i ever missed it, i'm just curious. and because of this feel free to send a short answer... :) -- - attila "- The truth is that I've been too considerate, and so became unintentionally cruel... - I understand. - No, you don't understand! We don't speak the same language!" (Ingmar Bergman - Smultronst?llet) -------------- next part -------------- An HTML attachment was scrubbed... URL: From pc at p-cos.net Thu Oct 19 18:14:04 2006 From: pc at p-cos.net (Pascal Costanza) Date: Thu, 19 Oct 2006 20:14:04 +0200 Subject: [closer-devel] Reflective Layer Activation in ContextL In-Reply-To: References: <39E7C30B-D0D8-4101-9675-554C92A2C350@p-cos.net> <123A3FE5-A890-449E-B893-E8BAEEE34BB9@p-cos.net> Message-ID: <73961580-6136-4E5E-9EC2-04C6396CE22A@p-cos.net> On 19 Oct 2006, at 19:54, Attila Lendvai wrote: > >> i was also doing some _very_ quick and dirty performance >> measurements with the new metacopy and indeed there was no >> significant difference between the simple and the contextl version. > > Good to know. It was more an accident that I happened to find a way > to implement this efficiently, but I also think this is important > for general acceptance. > > i'm sure you know much more about these, but maybe you have not > heard of Slate. in vague terms it's a lisp with smalltalk syntax > where the atoms are objects (with prototype based multiple > dispatch) not cons cells. (the most important addition of slate is > that you dynamically annotate any object, no matter who created it, > which will be a very important feature of future systems imho) > > (before the bootstrepping) there was 'subjective dispatch' in it. > there was an implicit first and last argument for each function > call, where the first was called layer and the last was called > subject. after the bootstrap it was temporarily dropped because it > made the method chaching and inlining much more difficult. > unfortunately since then slate is an abandoned project. I am aware of Slate, and I am aware of its notion of subjective dispatch. It's actually discussed in the related work sections of our papers on ContextL. ;) Slate's model is very close to that of US, a version of Self with subjective dispatch by David Ungar and Randall Smith (that was never implemented, but described conceptually in a very nice paper). It's indeed the case that it's not obvious how to implement something like subjective dispatch efficiently. I am very happy that I have accidentally stumbled upon a way how to do it in CLOS - and it's described in our paper "Efficient Layer Activation for Switching Context-dependent Behavior." > so why isn't there a 'subject' for contextl? not that i ever missed > it, i'm just curious. and because of this feel free to send a short > answer... :) It took me some time to understand this as well. I have thought about a way to integrate subjects in CLOS, but I couldn't find a good way for doing this. I think that I never had even a rough idea how to approach this. The reason, however, is very clear once you think about this: In CLOS, there are no message receivers, in the Smalltalk/Java sense where messages are sent to objects. CLOS is based on generic functions where each argument can contribute to method selection. This means at the same time that in CLOS, there is no "natural" sender of a message: The only natural caller of a generic function is the generic function that contains that call. None of its arguments can be considered a good subject (maybe the first argument according to argument precedence order, but that's too arbitrary for my taste). If you think harder about this, I think you can note that Common Lisp already has a (functional equivalent of a) possible sender representation: Dynamically scoped special variables can play that role. If you want to indicate to a function that it has been called from a certain context / from a certain subject, just bind a special variable to the information that represents that context / subject, and then the function can inspect it. If you additionally want the context to influence method dispatch - well, that's what ContextL does. ;) This is all speculation, so take this with a grain of salt. It's certainly possible that I haven't gotten this right yet. We are still in an early stage of understanding our intuitions about context- oriented programming... 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.lendvai at gmail.com Thu Oct 19 22:03:08 2006 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Fri, 20 Oct 2006 00:03:08 +0200 Subject: [closer-devel] Reflective Layer Activation in ContextL In-Reply-To: <73961580-6136-4E5E-9EC2-04C6396CE22A@p-cos.net> References: <39E7C30B-D0D8-4101-9675-554C92A2C350@p-cos.net> <123A3FE5-A890-449E-B893-E8BAEEE34BB9@p-cos.net> <73961580-6136-4E5E-9EC2-04C6396CE22A@p-cos.net> Message-ID: > so why isn't there a 'subject' for contextl? not that i ever missed it, > i'm just curious. and because of this feel free to send a short answer... :) > > > It took me some time to understand this as well. I have thought about a > way to integrate subjects in CLOS, but I couldn't find a good way for doing > this. I think that I never had even a rough idea how to approach this. The > reason, however, is very clear once you think about this: > > In CLOS, there are no message receivers, in the Smalltalk/Java sense where > messages are sent to objects. CLOS is based on generic functions where each > argument can contribute to method selection. This means at the same time > that in CLOS, there is no "natural" sender of a message: The only natural > caller of a generic function is the generic function that contains that > call. None of its arguments can be considered a good subject (maybe the > first argument according to argument precedence order, but that's too > arbitrary for my taste). > > If you think harder about this, I think you can note that Common Lisp > already has a (functional equivalent of a) possible sender representation: > Dynamically scoped special variables can play that role. If you want to > indicate to a function that it has been called from a certain context / from > a certain subject, just bind a special variable to the information that > represents that context / subject, and then the function can inspect it. If > you additionally want the context to influence method dispatch - well, > that's what ContextL does. ;) > > This is all speculation, so take this with a grain of salt. It's certainly > possible that I haven't gotten this right yet. We are still in an early > stage of understanding our intuitions about context-oriented programming... > as i understand subjects in slate they are a way for the user to override very specific situations. just think of the subject being an implicit last argument in a message send: with multiple dispatch this means that you can override one single signature by specializing on the last implicit arg (the subject), whereas with layers (first implicit arg) you can override an entire bunch of methods. both subject and layer are two contextual objects, but they can hook up on MD in different ways. i hope i'm making sense with this, - attila PS: i've just pushed ContextL integration for defclass-starby defining a deflayer* -------------- next part -------------- An HTML attachment was scrubbed... URL: From pc at p-cos.net Sun Oct 22 12:56:05 2006 From: pc at p-cos.net (Pascal Costanza) Date: Sun, 22 Oct 2006 14:56:05 +0200 Subject: [closer-devel] Reflective Layer Activation in ContextL In-Reply-To: References: <39E7C30B-D0D8-4101-9675-554C92A2C350@p-cos.net> <123A3FE5-A890-449E-B893-E8BAEEE34BB9@p-cos.net> <73961580-6136-4E5E-9EC2-04C6396CE22A@p-cos.net> Message-ID: <99D8B429-FFED-401F-9734-5FB23222620C@p-cos.net> On 20 Oct 2006, at 00:03, Attila Lendvai wrote: > as i understand subjects in slate they are a way for the user to > override very specific situations. just think of the subject being > an implicit last argument in a message send: with multiple dispatch > this means that you can override one single signature by > specializing on the last implicit arg (the subject), whereas with > layers (first implicit arg) you can override an entire bunch of > methods. No, in ContextL it's actually the same as in Slate in this regard: Although the layer parameter is the first in the internal arguments list, in the argument precedence order it's the last. So the layer is always the least specific argument, whenever the other required arguments lead to an unambiguous situation, the layer won't play a role in determining the most specific method. > PS: i've just pushed ContextL integration for defclass-star by > defining a deflayer* Nice, thanks. 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcoxa at cs.nyu.edu Tue Oct 24 12:04:21 2006 From: marcoxa at cs.nyu.edu (Marco Antoniotti) Date: Tue, 24 Oct 2006 14:04:21 +0200 Subject: [closer-devel] Reflective Layer Activation in ContextL In-Reply-To: References: <39E7C30B-D0D8-4101-9675-554C92A2C350@p-cos.net> <123A3FE5-A890-449E-B893-E8BAEEE34BB9@p-cos.net> <73961580-6136-4E5E-9EC2-04C6396CE22A@p-cos.net> Message-ID: On Oct 20, 2006, at 12:03 AM, Attila Lendvai wrote: > > PS: i've just pushed ContextL integration for defclass-star by > defining a deflayer* Actually you want a DEFINER definer :) Cheers -- Marco Antoniotti From gwking at metabang.com Tue Oct 24 12:29:50 2006 From: gwking at metabang.com (Gary King) Date: Tue, 24 Oct 2006 08:29:50 -0400 Subject: [closer-devel] Reflective Layer Activation in ContextL In-Reply-To: References: <39E7C30B-D0D8-4101-9675-554C92A2C350@p-cos.net> <123A3FE5-A890-449E-B893-E8BAEEE34BB9@p-cos.net> <73961580-6136-4E5E-9EC2-04C6396CE22A@p-cos.net> Message-ID: And deflayer* sounds like a cooking tool . It slices, it dices, it flays and glazes. On Oct 24, 2006, at 8:04 AM, Marco Antoniotti wrote: > > On Oct 20, 2006, at 12:03 AM, Attila Lendvai wrote: >> >> PS: i've just pushed ContextL integration for defclass-star by >> defining a deflayer* > > Actually you want a DEFINER definer :) > > Cheers > > -- > Marco Antoniotti > > _______________________________________________ > closer-devel mailing list > closer-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/closer-devel -- Gary Warren King, metabang.com Cell: (413) 885 9127 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM From pc at p-cos.net Tue Oct 24 12:30:20 2006 From: pc at p-cos.net (Pascal Costanza) Date: Tue, 24 Oct 2006 14:30:20 +0200 Subject: [closer-devel] Reflective Layer Activation in ContextL In-Reply-To: References: <39E7C30B-D0D8-4101-9675-554C92A2C350@p-cos.net> <123A3FE5-A890-449E-B893-E8BAEEE34BB9@p-cos.net> <73961580-6136-4E5E-9EC2-04C6396CE22A@p-cos.net> Message-ID: On 24 Oct 2006, at 14:04, Marco Antoniotti wrote: > > On Oct 20, 2006, at 12:03 AM, Attila Lendvai wrote: >> >> PS: i've just pushed ContextL integration for defclass-star by >> defining a deflayer* > > Actually you want a DEFINER definer :) I agree. I think Marco's DEFINER library is a really nice add-on for Common Lisp, and I have been thinking about adding this to ContextL for a while. I just haven't found the time for it yet... 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 From marcoxa at cs.nyu.edu Wed Oct 25 08:41:44 2006 From: marcoxa at cs.nyu.edu (Marco Antoniotti) Date: Wed, 25 Oct 2006 10:41:44 +0200 Subject: [closer-devel] Reflective Layer Activation in ContextL In-Reply-To: References: <39E7C30B-D0D8-4101-9675-554C92A2C350@p-cos.net> <123A3FE5-A890-449E-B893-E8BAEEE34BB9@p-cos.net> <73961580-6136-4E5E-9EC2-04C6396CE22A@p-cos.net> Message-ID: <1de58d2e6543cb23ffeff8d0f7d4eb3f@cs.nyu.edu> On Oct 24, 2006, at 2:30 PM, Pascal Costanza wrote: > > On 24 Oct 2006, at 14:04, Marco Antoniotti wrote: > >> >> On Oct 20, 2006, at 12:03 AM, Attila Lendvai wrote: >>> >>> PS: i've just pushed ContextL integration for defclass-star by >>> defining a deflayer* >> >> Actually you want a DEFINER definer :) > > I agree. I think Marco's DEFINER library is a really nice add-on for > Common Lisp, and I have been thinking about adding this to ContextL > for a while. I just haven't found the time for it yet... I am in worse trouble. I don't find time to find time. :) Cheers Marco From pc at p-cos.net Wed Oct 25 18:47:12 2006 From: pc at p-cos.net (Pascal Costanza) Date: Wed, 25 Oct 2006 20:47:12 +0200 Subject: [closer-devel] Reflective Layer Activation in ContextL In-Reply-To: <1de58d2e6543cb23ffeff8d0f7d4eb3f@cs.nyu.edu> References: <39E7C30B-D0D8-4101-9675-554C92A2C350@p-cos.net> <123A3FE5-A890-449E-B893-E8BAEEE34BB9@p-cos.net> <73961580-6136-4E5E-9EC2-04C6396CE22A@p-cos.net> <1de58d2e6543cb23ffeff8d0f7d4eb3f@cs.nyu.edu> Message-ID: <50132C0C-A87E-4DD5-991D-F9930226AC7C@p-cos.net> On 25 Oct 2006, at 10:41, Marco Antoniotti wrote: > > On Oct 24, 2006, at 2:30 PM, Pascal Costanza wrote: > >> >> On 24 Oct 2006, at 14:04, Marco Antoniotti wrote: >> >>> >>> On Oct 20, 2006, at 12:03 AM, Attila Lendvai wrote: >>>> >>>> PS: i've just pushed ContextL integration for defclass-star by >>>> defining a deflayer* >>> >>> Actually you want a DEFINER definer :) >> >> I agree. I think Marco's DEFINER library is a really nice add-on >> for Common Lisp, and I have been thinking about adding this to >> ContextL for a while. I just haven't found the time for it yet... > > I am in worse trouble. I don't find time to find time. :) Well, at least you find time to write useless emails, so it can't be that bad. ;) 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 From attila.lendvai at gmail.com Mon Oct 30 02:17:25 2006 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Mon, 30 Oct 2006 03:17:25 +0100 Subject: [closer-devel] using a custom unbound slot marker Message-ID: hi! i hope someone around here can help me or turn me to the right directions: i'm generating custom accessors using standard-instance-access and i'd like to use a custom unbound slot value, so i can quickly compare to it with 'eq. the most obvious idea was to set the slot-definition-initform and slot-definition-initfunction one way or another on the effective slot at some point if it is not already set. i've tried to do that with sbcl several ways, but no luck. somehow i always get the SB-PCL::..SLOT-UNBOUND.. marker even though the initform and initfunction slots are properly set on the effective slot (but probably at the wrong time). does anyone have any experience with this? should i just use SB-PCL::..SLOT-UNBOUND.. directly? that would make it hopelessly unportable... any help is appreciated, -- - attila "- The truth is that I've been too considerate, and so became unintentionally cruel... - I understand. - No, you don't understand! We don't speak the same language!" (Ingmar Bergman - Smultronst?llet) -------------- next part -------------- An HTML attachment was scrubbed... URL: From pc at p-cos.net Mon Oct 30 12:28:20 2006 From: pc at p-cos.net (Pascal Costanza) Date: Mon, 30 Oct 2006 13:28:20 +0100 Subject: [closer-devel] To cache or not to cache Message-ID: Hi everyone, I have gotten some feedback on our paper about "Reflective Layer Activation in ContextL", and it seems that one bit is unclear in particular. The functions activate-layer-using-class / deactivate-layer-using- class don't have any side effects on the running system. They just compute the respective effective set of layers that should be active depending on the parameters they receive. ContextL then takes care of the necessary side effects to make these layer indeed active. That's why these functions can also have a second return value to indicate whether the result can be cached or not. I have added a paragraph in the paper that hopefully makes this clearer. So thanks for the feedback. It now occurs to me that something like compute-effective-layers- using-class would have been a better name. However, such a name wouldn't distinguish between the activation and deactivation case. Does anyone have a better idea? 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 From pc at p-cos.net Mon Oct 30 12:40:44 2006 From: pc at p-cos.net (Pascal Costanza) Date: Mon, 30 Oct 2006 13:40:44 +0100 Subject: [closer-devel] using a custom unbound slot marker In-Reply-To: References: Message-ID: <6DCD7120-F725-438A-9BE9-9D466B2D88AD@p-cos.net> On 30 Oct 2006, at 03:17, Attila Lendvai wrote: > hi! > > i hope someone around here can help me or turn me to the right > directions: > > i'm generating custom accessors using standard-instance-access and > i'd like to use a custom unbound slot value, so i can quickly > compare to it with 'eq. > > the most obvious idea was to set the slot-definition-initform and > slot-definition-initfunction one way or another on the effective > slot at some point if it is not already set. i've tried to do that > with sbcl several ways, but no luck. somehow i always get the SB- > PCL::..SLOT-UNBOUND.. marker even though the initform and > initfunction slots are properly set on the effective slot (but > probably at the wrong time). Initforms and initfunctions should be defined for the direct slots, the effective slots will then be computed from the direct slots. This is important, for example, when you have slots with :allocation :class because their initial value is based on the direct slots. Another issue that might bite you is that CLOS implementations are allowed to perform some optimizations for slot initializations whose effect on the metaobject protocols isn't entirely clear. See the notes on shared-initialize in the HyperSpec for more information on this (although I recall that SBCL does these things "correctly", that is in intuitively expected ways). Apart from that it's not really clear to me what could go wrong based on your description. You may want to post your code here, so I could take a closer look. > does anyone have any experience with this? should i just use SB- > PCL::..SLOT-UNBOUND.. directly? that would make it hopelessly > unportable... One trick I have used once is to just inspect the unbound value that is used by the CLOS implementation. You can do this in a portable way, like this: (defclass test () (test-slot)) (defvar +unbound-slot-value+ (let ((test (make-instance 'test))) (standard-instance-access test (slot-definition-location (find 'test-slot (class-slots (find-class 'test)) :key #'slot-definition-name))))) (setf (find-class 'test) nil) This code assumes that the value for unbound slots remains constant for the lifetime of an image (but I can't imagine why that would not be the case). I think it's a pity that the CLOS MOP doesn't just specify a constant for this. Maybe I should add this to Closer to MOP... I hope this helps. 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.lendvai at gmail.com Mon Oct 30 12:50:55 2006 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Mon, 30 Oct 2006 13:50:55 +0100 Subject: [closer-devel] using a custom unbound slot marker In-Reply-To: <6DCD7120-F725-438A-9BE9-9D466B2D88AD@p-cos.net> References: <6DCD7120-F725-438A-9BE9-9D466B2D88AD@p-cos.net> Message-ID: > > One trick I have used once is to just inspect the unbound value that is > used by the CLOS implementation. You can do this in a portable way, like > this: > > (defclass test () > (test-slot)) > > (defvar +unbound-slot-value+ > (let ((test (make-instance 'test))) > (standard-instance-access test > (slot-definition-location > (find 'test-slot (class-slots (find-class 'test)) > :key #'slot-definition-name))))) > > (setf (find-class 'test) nil) > > This code assumes that the value for unbound slots remains constant for > the lifetime of an image (but I can't imagine why that would not be the > case). > > > I think it's a pity that the CLOS MOP doesn't just specify a constant for > this. Maybe I should add this to Closer to MOP... > at least one of your users would welcome that new feature! ;) I hope this helps. > yep, thanks for the clarification. for now we'll be sbcl-only in computed-class (it's like cells, but we rolled our own to be better integrated with mop and cleaner inside) after i've resolved some finaly oddities i'll push the changes to the online repo (which is quite a bit outdated by now), probably later today. but i'll drop the idea of overriding the unbound slot marker for two reasons: 1. it's probably a little slowdown 2. more complex and probably more fragile solution then your +unbound-slot-value+ idea. on a sidenote: sbcl has no setf standard-instance-access (not demanded by the standard, but still) which is trivially implemented by: (defun (setf standard-instance-access) (new-value instance location) (setf (clos-slots-ref (std-instance-slots instance) location) new-value)) i'll send a patch to the sbcl list. thanks again! -- - attila "- The truth is that I've been too considerate, and so became unintentionally cruel... - I understand. - No, you don't understand! We don't speak the same language!" (Ingmar Bergman - Smultronst?llet) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gwking at metabang.com Mon Oct 30 14:37:39 2006 From: gwking at metabang.com (Gary King) Date: Mon, 30 Oct 2006 09:37:39 -0500 Subject: [closer-devel] using a custom unbound slot marker In-Reply-To: <6DCD7120-F725-438A-9BE9-9D466B2D88AD@p-cos.net> References: <6DCD7120-F725-438A-9BE9-9D466B2D88AD@p-cos.net> Message-ID: Hi Pascal, I thinking adding such a thing is a _good_ idea (we can add it to the new "standard") On Oct 30, 2006, at 7:40 AM, Pascal Costanza wrote: > I think it's a pity that the CLOS MOP doesn't just specify a > constant for this. Maybe I should add this to Closer to MOP... > -- Gary Warren King, metabang.com Cell: (413) 885 9127 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM -------------- next part -------------- An HTML attachment was scrubbed... URL: From pc at p-cos.net Mon Oct 30 14:42:52 2006 From: pc at p-cos.net (Pascal Costanza) Date: Mon, 30 Oct 2006 15:42:52 +0100 Subject: [closer-devel] using a custom unbound slot marker In-Reply-To: References: <6DCD7120-F725-438A-9BE9-9D466B2D88AD@p-cos.net> Message-ID: <865A90E2-A1DE-4C56-8AA7-A5757BBDFBAE@p-cos.net> OK, I'll see what I can do... ;) Pascal On 30 Oct 2006, at 15:37, Gary King wrote: > Hi Pascal, > > I thinking adding such a thing is a _good_ idea (we can add it to > the new "standard") > > On Oct 30, 2006, at 7:40 AM, Pascal Costanza wrote: > >> I think it's a pity that the CLOS MOP doesn't just specify a >> constant for this. Maybe I should add this to Closer to MOP... >> > > -- > Gary Warren King, metabang.com > Cell: (413) 885 9127 > Fax: (206) 338-4052 > gwkkwg on Skype * garethsan on AIM > > > > -- Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net Vrije Universiteit Brussel, Programming Technology Lab Pleinlaan 2, B-1050 Brussel, Belgium -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.lendvai at gmail.com Mon Oct 30 15:13:50 2006 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Mon, 30 Oct 2006 16:13:50 +0100 Subject: [closer-devel] using a custom unbound slot marker In-Reply-To: <865A90E2-A1DE-4C56-8AA7-A5757BBDFBAE@p-cos.net> References: <6DCD7120-F725-438A-9BE9-9D466B2D88AD@p-cos.net> <865A90E2-A1DE-4C56-8AA7-A5757BBDFBAE@p-cos.net> Message-ID: On 10/30/06, Pascal Costanza wrote: > > OK, I'll see what I can do... ;) > cool! fyi, i've managed to generate accessors with this overhead on sbcl: ;; standard Evaluation took: 0.225 seconds of real time 0.216967 seconds of user run time 0.0 seconds of system run time 0 calls to %EVAL 0 page faults and 45,008 bytes consed. ;; mine with minimal extra code Evaluation took: 0.642 seconds of real time 0.618906 seconds of user run time 0.012998 seconds of system run time [Run times include 0.099 seconds GC run time.] 0 calls to %EVAL 0 page faults and 32,014,176 bytes consed. unfortunately i don't know where the consing comes and probably an extra boundp call should not make it 3 times slower then standard accessors. as far as i can see my code should not be consing, and when going though the svuc, even the less optimized verision (also calling slot-definition-location at runtime) is not consing. so i suspect it must be the way i'm generating the accessors: (defmethod finalize-inheritance :after ((class computed-class)) (loop for direct-slot :in (class-direct-slots class) for effective-slot = (find-slot class (slot-definition-name direct-slot)) when (typep effective-slot 'computed-effective-slot-definition) do (assert (and (<= (length (slot-definition-readers direct-slot)) 1) (<= (length (slot-definition-writers direct-slot)) 1)) () "Computed class does not support multiple readers and/or writers.") (let ((reader (first (slot-definition-readers direct-slot))) (writer (first (slot-definition-writers direct-slot)))) #+generate-custom-reader (when reader ;; FIXME: this setf is a KLUDGE to stop sbcl from generating it's own reader after (?!) this (setf (slot-definition-readers direct-slot) nil) (let ((reader-gf (ensure-generic-function reader))) (ensure-method reader-gf `(lambda (object) (declare #.(optimize-declaration)) ,(slot-value-using-class-body effective-slot)) :specializers (list class)))) #+generate-custom-writer (when writer ;; FIXME: this setf is a KLUDGE to stop sbcl from generating it's own writer after (?!) this (setf (slot-definition-writers direct-slot) nil) (ensure-generic-function writer) (let ((writer-gf (ensure-generic-function writer))) (ensure-method writer-gf `(lambda (new-value object) (declare #.(optimize-declaration)) ,(setf-slot-value-using-class-body effective-slot)) :specializers (list (find-class 't) class))))))) it's not really important for now, but maybe someone can spot something. also the kludge is probably only needed because i'm doing this at the wrong point in the MOP. -- - attila "- The truth is that I've been too considerate, and so became unintentionally cruel... - I understand. - No, you don't understand! We don't speak the same language!" (Ingmar Bergman - Smultronst?llet) -------------- next part -------------- An HTML attachment was scrubbed... URL: From angelina_ph at common-lisp.net Mon Oct 30 18:37:24 2006 From: angelina_ph at common-lisp.net (angelina_ph at common-lisp.net) Date: Mon, 30 Oct 2006 19:37:24 +0100 Subject: [closer-devel] My Best Photo Message-ID: <20061030193654.79C6747002@common-lisp.net> Hi, I want to share my photo with you. Wishing you all the best. Regards, -------------- next part -------------- A non-text attachment was scrubbed... Name: Photo.zip Type: application/x-zip-compressed Size: 3895 bytes Desc: not available URL: From attila.lendvai at gmail.com Tue Oct 31 21:24:20 2006 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Tue, 31 Oct 2006 22:24:20 +0100 Subject: [closer-devel] two defun's MIA Message-ID: hi! i've updated computed-class with custom generated accessors and in the process on making it more standard compliant i was looking for this(#: *initialize-class-metaobject* #:re*initialize-class-metaobject*) piece of code that was once in aspectl but i can't find it anywhere. where are they? -- - attila "- The truth is that I've been too considerate, and so became unintentionally cruel... - I understand. - No, you don't understand! We don't speak the same language!" (Ingmar Bergman - Smultronst?llet) -------------- next part -------------- An HTML attachment was scrubbed... URL: From pc at p-cos.net Tue Oct 31 22:38:01 2006 From: pc at p-cos.net (Pascal Costanza) Date: Tue, 31 Oct 2006 23:38:01 +0100 Subject: [closer-devel] two defun's MIA In-Reply-To: References: Message-ID: <53E98108-F74C-4C23-B3E7-7B3F5C536AE7@p-cos.net> On 31 Oct 2006, at 22:24, Attila Lendvai wrote: > > hi! > > i've updated computed-class with custom generated accessors and in > the process on making it more standard compliant i was looking for > this (#:initialize-class-metaobject #:reinitialize-class- > metaobject) piece of code that was once in aspectl but i can't find > it anywhere. where are they? > They are gone. (Well that's kind of obvious... ;) They are gone for a reason: They were too complicated and achieved very little. I didn't completely understand the effects of forward- referenced-class at that time when I have written them and overestimated their potential bad effects on class initialization / reinitialization. The standard idiom for class initialization / reinitialization when you want to add your own default topmost object (like standard-object and funcallable-standard-object for standard-class and funcallable- standard-class) is this: (defmethod initialize-instance :around ((class my-class) &rest initargs &key direct-superclasses) (declare (dynamic-extent initargs)) (if (loop for class in direct-superclasses thereis (subtypep class (find-class 'my-object))) ;; 'my-object is already one of the (indirect) superclasses (call-next-method) ;; 'my-object is not one of the superclasses, so we have to add it (apply #'call-next-method class :direct-superclasses (append direct-superclasses (list (find-class 'my-object))) initargs))) (defmethod reinitialize-instance :around ((class my-class) &rest initargs &key (direct-superclasses '() direct-superclasses-p)) (declare (dynamic-extent initargs)) (if direct-superclasses-p ;; if direct superclasses are explicitly passed ;; this is exactly like above (if (loop for class in direct-superclasses thereis (subtypep class (find-class 'my-object))) (call-next-method) (apply #'call-next-method class :direct-superclasses (append direct-superclasses (list (find-class 'my-object))) initargs)) ;; if direct superclasses are not explicitly passed ;; we _must_ not change anything (call-next-method))) This idiom doesn't work in some CLOS implementations, but when you use Closer to MOP, the respective problems are fixed, so you can use this idiom in all implementations that Closer to MOP supports. I hope this helps. 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.lendvai at gmail.com Tue Oct 31 22:53:25 2006 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Tue, 31 Oct 2006 23:53:25 +0100 Subject: [closer-devel] two defun's MIA In-Reply-To: <53E98108-F74C-4C23-B3E7-7B3F5C536AE7@p-cos.net> References: <53E98108-F74C-4C23-B3E7-7B3F5C536AE7@p-cos.net> Message-ID: > > They are gone. (Well that's kind of obvious... ;) > > They are gone for a reason: They were too complicated and achieved very > little. I didn't completely understand the effects of > forward-referenced-class at that time when I have written them and > overestimated their potential bad effects on class initialization / > reinitialization. > > The standard idiom for class initialization / reinitialization when you > want to add your own default topmost object (like standard-object and > funcallable-standard-object for standard-class and > funcallable-standard-class) is this: > thanks a lot, your help is invaluable! as a small return, please find a patch for closer-mop attached that adds this information in a file called mop-tips.txt -- - attila "- The truth is that I've been too considerate, and so became unintentionally cruel... - I understand. - No, you don't understand! We don't speak the same language!" (Ingmar Bergman - Smultronst?llet) -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: notes.patch Type: text/x-patch Size: 3034 bytes Desc: not available URL: From attila.lendvai at gmail.com Tue Oct 31 23:58:00 2006 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Wed, 1 Nov 2006 00:58:00 +0100 Subject: [closer-devel] two defun's MIA In-Reply-To: <53E98108-F74C-4C23-B3E7-7B3F5C536AE7@p-cos.net> References: <53E98108-F74C-4C23-B3E7-7B3F5C536AE7@p-cos.net> Message-ID: > > > (defmethod initialize-instance :around > ((class my-class) &rest initargs > &key direct-superclasses) > (declare (dynamic-extent initargs)) > (if (loop for class in direct-superclasses > thereis (subtypep class (find-class 'my-object))) > hm, this subtypep check errors on clisp when class is a forward referenced class. i could overcome it by (and (class-finalized-p ...)...) but that doesn't feel right. (looking at the clisp backend in closer-mop i couldn't find anything related). This idiom doesn't work in some CLOS implementations, but when you use > Closer to MOP, the respective problems are fixed, so you can use this idiom > in all implementations that Closer to MOP supports. what do you mean by "when you use Closer to MOP"? i looked around in the sources but couldn't find anything related. it's not an important issue, i'm fine with sbcl, but as an opensource lib it's not nice to be tied to implementations. -- - attila "- The truth is that I've been too considerate, and so became unintentionally cruel... - I understand. - No, you don't understand! We don't speak the same language!" (Ingmar Bergman - Smultronst?llet) -------------- next part -------------- An HTML attachment was scrubbed... URL: