From =?windows-1255?Q?=E0=EC=E5 at common-lisp.net Mon Jul 16 02:23:20 2007 From: =?windows-1255?Q?=E0=EC=E5 at common-lisp.net (=?windows-1255?Q?=E0=EC=E5 at common-lisp.net) Date: Mon, 16 Jul 2007 04:23:20 +0200 Subject: [closer-devel] =?windows-1255?b?7Ofh+OX6IOD44uXw6e0g5fLx9+ntIC0g?= =?windows-1255?b?7Pfw5fog5ez6+OXtIOzg7OUi6A==?= Message-ID: An HTML attachment was scrubbed... URL: From attila.lendvai at gmail.com Thu Jul 19 21:34:41 2007 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Thu, 19 Jul 2007 23:34:41 +0200 Subject: [closer-devel] define-layered-method syntax Message-ID: hi! i've added various macros over d-l-m, all with syntax like this: (define-backend-method (present-title pdf) ((self instance-renderer) (view standard-view)) ...) and i tought that d-l-m itself could use this syntax: (define-layered-method (display-object employment-layer) ((object employer)) ...) instead of this: (define-layered-method display-object :in-layer employment-layer ((object employer)) ...) what do you think? -- attila From penguin at ocean.vvo.ru Thu Jul 19 22:46:43 2007 From: penguin at ocean.vvo.ru (Igor Plekhov) Date: Fri, 20 Jul 2007 09:46:43 +1100 Subject: [closer-devel] define-layered-method syntax In-Reply-To: References: Message-ID: <20070719224643.GR29990@ocean.vvo.ru> On Thu, 19 Jul, 2007 at 23:34:41 +0200, Attila Lendvai wrote: > > and i tought that d-l-m itself could use this syntax: > > (define-layered-method (display-object employment-layer) ((object employer)) > ...) Then what about :before, :after methods? What syntax they would use? > instead of this: > > (define-layered-method display-object :in-layer employment-layer > ((object employer)) > ...) -- Registered Linux User #124759 From attila.lendvai at gmail.com Thu Jul 19 23:12:12 2007 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Fri, 20 Jul 2007 01:12:12 +0200 Subject: [closer-devel] define-layered-method syntax In-Reply-To: <20070719224643.GR29990@ocean.vvo.ru> References: <20070719224643.GR29990@ocean.vvo.ru> Message-ID: > Then what about :before, :after methods? What syntax they would use? the syntax would be almost the same as defmethod, with an exception that name may be a list, in which case its second element is the layer name. this scheme also makes it possible to include keyword arguments later, when/if the need comes. i don't want to push it too much, though, just wanted to pop up the idea. -- attila From pc at p-cos.net Thu Jul 19 23:38:55 2007 From: pc at p-cos.net (Pascal Costanza) Date: Fri, 20 Jul 2007 01:38:55 +0200 Subject: [closer-devel] define-layered-method syntax In-Reply-To: References: <20070719224643.GR29990@ocean.vvo.ru> Message-ID: <705094EB-FCF2-4C84-B665-B719D068DE2C@p-cos.net> On 20 Jul 2007, at 01:12, Attila Lendvai wrote: >> Then what about :before, :after methods? What syntax they would use? > > the syntax would be almost the same as defmethod, with an exception > that name may be a list, in which case its second element is the layer > name. Common Lisp already has a notion of function names as lists, in the form of '(setf function-name). So that case would have to be covered as well. I would not like to go that route because I recall reading other discussions about extending acceptable function names, with some ideas about other indicators beyond 'setf. I prefer not to create opportunities for potential clashes here. Of course, your suggestion would have the advantage that it saves some space. I have already been hit by this a couple of times, trying to fit examples of layered methods in papers. ;) In your experience, how much better is your proposed syntax? 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 attila.lendvai at gmail.com Fri Jul 20 00:00:04 2007 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Fri, 20 Jul 2007 02:00:04 +0200 Subject: [closer-devel] define-layered-method syntax In-Reply-To: <705094EB-FCF2-4C84-B665-B719D068DE2C@p-cos.net> References: <20070719224643.GR29990@ocean.vvo.ru> <705094EB-FCF2-4C84-B665-B719D068DE2C@p-cos.net> Message-ID: > Common Lisp already has a notion of function names as lists, in the > form of '(setf function-name). So that case would have to be covered > as well. oh, heh, to be honest i didn't think of that... > Of course, your suggestion would have the advantage that it saves > some space. I have already been hit by this a couple of times, trying > to fit examples of layered methods in papers. ;) In your experience, > how much better is your proposed syntax? well, in situations like this "better" is a question of taste... :) i like the proposed syntax more for its compactness and somehow my paren-matcher (brain) can also pick up the layer name better this way. it didn't cause me any headaches yet, but i have to admit, that i've never wanted to work with layered setf methods... but handling them should be doable. for example: (d-l-m ((setf foo) some-layer) (new-value arg1) ...) but either case, i think we should avoid playing dirty tricks with things like (setf foo some-layer) the background is that recently i had to reach under my d-l-m wrappers and define a layered method on a combination of a backend and a form, which my wrapper macros didn't support. and i got used to them so much that the "barebone" d-l-m with its :in-layer just felt strange. therefore this proposal/question was born. -- attila From attila.lendvai at gmail.com Fri Jul 20 13:38:41 2007 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Fri, 20 Jul 2007 15:38:41 +0200 Subject: [closer-devel] PATCH: Better print-object for layers: print the layer precedence list for unnamed layers Message-ID: hth, -- attila -------------- next part -------------- A non-text attachment was scrubbed... Name: better-print-object-for-layers.patch Type: text/x-diff Size: 1125 bytes Desc: not available URL: From pc at p-cos.net Sat Jul 21 12:07:18 2007 From: pc at p-cos.net (Pascal Costanza) Date: Sat, 21 Jul 2007 14:07:18 +0200 Subject: [closer-devel] define-layered-method syntax In-Reply-To: References: <20070719224643.GR29990@ocean.vvo.ru> <705094EB-FCF2-4C84-B665-B719D068DE2C@p-cos.net> Message-ID: On 20 Jul 2007, at 02:00, Attila Lendvai wrote: >> Common Lisp already has a notion of function names as lists, in the >> form of '(setf function-name). So that case would have to be covered >> as well. > > oh, heh, to be honest i didn't think of that... > >> Of course, your suggestion would have the advantage that it saves >> some space. I have already been hit by this a couple of times, trying >> to fit examples of layered methods in papers. ;) In your experience, >> how much better is your proposed syntax? > > well, in situations like this "better" is a question of taste... :) i > like the proposed syntax more for its compactness and somehow my > paren-matcher (brain) can also pick up the layer name better this way. > it didn't cause me any headaches yet, but i have to admit, that i've > never wanted to work with layered setf methods... but handling them > should be doable. for example: > > (d-l-m ((setf foo) some-layer) (new-value arg1) ...) That's still an easy case. I am more concerned about this: (d-l-m (setf foo) (...) ...) Is this a method for '(setf foo) in the layer 't, or is this a method for 'setf in the layer 'foo? Of course, per ANSI Common Lisp we are not allowed to define a function 'setf. But what if some library or some CL implementation comes up with additional extended function names, like: (d-l-m (letf foo) (...) ...) So in order to avoid clashes of naming conventions, I would have to require that layers are always specified, even when they are just 't. I'd find that more awkward than having to say :in-layer some-layer. > but either case, i think we should avoid playing dirty tricks with > things like (setf foo some-layer) > > the background is that recently i had to reach under my d-l-m wrappers > and define a layered method on a combination of a backend and a form, > which my wrapper macros didn't support. and i got used to them so much > that the "barebone" d-l-m with its :in-layer just felt strange. > therefore this proposal/question was born. I also sometimes get confused myself and forget where :in-layer has to be placed (especially in define-layered-class). But I couldn't come up with something better yet, given the issues some of which I have sketched above. As a small workaround for the wordiness of the keyword, I could accept :in as an alternative for :in-layer. Would that help at least a little? Please also keep in mind that define-layered-method already provides an extension for accessing the current layer: (d-l-m foo :in-layer (l some-layer) (...) ...) This binds the current layer to the local variable l. This is, for example, useful when using call-next-method and you want to change some of the parameters. 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 Sat Jul 21 12:11:21 2007 From: pc at p-cos.net (Pascal Costanza) Date: Sat, 21 Jul 2007 14:11:21 +0200 Subject: [closer-devel] PATCH: Better print-object for layers: print the layer precedence list for unnamed layers In-Reply-To: References: Message-ID: <6424F228-370F-4D11-88C2-4FBB948EC30C@p-cos.net> OK, this looks good, I will add this. Two questions: - Does it matter if any of the layers in the precedence list are anonymous? - Shouldn't print-object additionally say that the layer itself is anonymous? Thanks, Pascal On 20 Jul 2007, at 15:38, Attila Lendvai wrote: > hth, > -- > attila > > _______________________________________________ > 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, Programming Technology Lab Pleinlaan 2, B-1050 Brussel, Belgium -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.lendvai at gmail.com Mon Jul 30 16:26:33 2007 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Mon, 30 Jul 2007 18:26:33 +0200 Subject: [closer-devel] define-layered-method syntax In-Reply-To: References: <20070719224643.GR29990@ocean.vvo.ru> <705094EB-FCF2-4C84-B665-B719D068DE2C@p-cos.net> Message-ID: > So in order to avoid clashes of naming conventions, I would have to > require that layers are always specified, even when they are just 't. > I'd find that more awkward than having to say :in-layer some-layer. after reading your mail i think you are right, my proposed syntax could be confusing in some situations. > have sketched above. As a small workaround for the wordiness of the > keyword, I could accept :in as an alternative for :in-layer. Would > that help at least a little? i was hesitant for a moment, but it's define-LAYERED-method after all, so what else would :in mean? > Please also keep in mind that define-layered-method already provides > an extension for accessing the current layer: > > (d-l-m foo :in-layer (l some-layer) (...) ...) > > This binds the current layer to the local variable l. This is, for > example, useful when using call-next-method and you want to change > some of the parameters. i remember looking for that feature once, thanks for the heads-up! :) -- attila From attila.lendvai at gmail.com Mon Jul 30 16:40:21 2007 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Mon, 30 Jul 2007 18:40:21 +0200 Subject: [closer-devel] PATCH: Better print-object for layers: print the layer precedence list for unnamed layers In-Reply-To: <6424F228-370F-4D11-88C2-4FBB948EC30C@p-cos.net> References: <6424F228-370F-4D11-88C2-4FBB948EC30C@p-cos.net> Message-ID: > OK, this looks good, I will add this. thanks! > Two questions: > > - Does it matter if any of the layers in the precedence list are anonymous? i think all i wanted to know is a list of enabled layers... > - Shouldn't print-object additionally say that the layer itself is > anonymous? ...but any information over that can be potentially useful. when i need even more information, then i usually customize the slime inspector. i've also sent a patch to sbcl-devel that makes sbcl print the object identity for unnamed classes, which was also a must-have when i was debugging a problem i was looking for. but it's not in the official, yet. -- attila From =?iso-8859-8?Q?=EE=F6 at common-lisp.net Tue Jul 31 16:00:57 2007 From: =?iso-8859-8?Q?=EE=F6 at common-lisp.net (=?iso-8859-8?Q?=EE=F6 at common-lisp.net) Date: Tue, 31 Jul 2007 19:00:57 +0300 Subject: [closer-devel] =?iso-8859-8?b?+eXl5CDr7CDg4uX45CD57OAg+vn36fLl?= Message-ID: <583a17fc79393760ea877b30001ba325@delek.com> An HTML attachment was scrubbed... URL: