james anderson | 9 Sep 12:37

make-method-lambda ?

morning;

make-method-lambda is a know symbol, but defmethod reads as if it is  
implemented without it.

are there any plans to include it in the ccl mop?

thanks,
Pascal Costanza | 9 Sep 13:13

Re: make-method-lambda ?

Hi,

I tried to use make-method-lambda in SBCL and LispWorks, and my  
conclusion by now is that it's better to do without. I even presented  
a paper at this year's European Lisp Workshop, where you can read  
about some of my reasons.

What do you want to achieve? In most cases, there are easier ways than  
make-method-lambda to achieve what you want...

Pascal

On 9 Sep 2008, at 12:38, james anderson wrote:

> morning;
>
> make-method-lambda is a know symbol, but defmethod reads as if it is
> implemented without it.
>
> are there any plans to include it in the ccl mop?
>
> thanks,
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel <at> clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel

--

-- 
Pascal Costanza, mailto:pc <at> p-cos.net, http://p-cos.net
(Continue reading)

james anderson | 9 Sep 15:13

Re: make-method-lambda ?

[i sent an indication of my sentiments to pascal, but suppose it  
would be good to add them here to the record]

hi;

On 2008-09-09, at 07:13 , Pascal Costanza wrote:

> Hi,
>
> I tried to use make-method-lambda in SBCL and LispWorks, and my  
> conclusion by now is that it's better to do without. I even  
> presented a paper at this year's European Lisp Workshop, where you  
> can read about some of my reasons.

i've re-read it and remain unconvinced.
i'd rather see [make-method-lambda] implemented with its drawbacks,  
than not see it at all.

[more detailed than in the original]
the paper describes a number of things which make make-method-lambda  
difficult to use.
i'm quite prepared to live without being able to close at will. it's  
more important to be able to control the definition at all.

my prior usage for the example which you gave was to use make-method- 
lambda to generate the method function. one cannot expect a vanilla  
closure to work.

>
> What do you want to achieve? In most cases, there are easier ways  
(Continue reading)

Pascal Costanza | 9 Sep 15:52

Re: make-method-lambda ?


On 9 Sep 2008, at 15:13, james anderson wrote:

>> What do you want to achieve? In most cases, there are easier ways
>> than make-method-lambda to achieve what you want...
>
> manipulate the arguments passed to the method.

(defmacro define-manipulated-method (name (&rest args) &body body)
   (let ((unspecialized-args (extract-lambda-list args)))
     `(defmethod ,name ,args
        (apply (lambda ,unspecialized-args ,@body)
          (manipulate-args
            (list ,@(loop for arg in unspecialized-args
                          unless (member arg lambda-list-keywords)
                          collect arg)))))))

?!?

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
(Continue reading)

james anderson | 9 Sep 16:19

Re: make-method-lambda ?

i was hoping to avoid define-manipulated-method.

On 2008-09-09, at 09:52 , Pascal Costanza wrote:

>
> On 9 Sep 2008, at 15:13, james anderson wrote:
>
>>> What do you want to achieve? In most cases, there are easier ways
>>> than make-method-lambda to achieve what you want...
>>
>> manipulate the arguments passed to the method.
>
>
> (defmacro define-manipulated-method (name (&rest args) &body body)
>   (let ((unspecialized-args (extract-lambda-list args)))
>     `(defmethod ,name ,args
>        (apply (lambda ,unspecialized-args ,@body)
>          (manipulate-args
>            (list ,@(loop for arg in unspecialized-args
>                          unless (member arg lambda-list-keywords)
>                          collect arg)))))))
>
> ?!?
>
>
> Pascal
>
> -- 
> Pascal Costanza, mailto:pc <at> p-cos.net, http://p-cos.net
> Vrije Universiteit Brussel, Programming Technology Lab
(Continue reading)

Pascal Costanza | 9 Sep 18:26

Re: make-method-lambda ?

why?

On 9 Sep 2008, at 16:19, james anderson wrote:

> i was hoping to avoid define-manipulated-method.
>
> On 2008-09-09, at 09:52 , Pascal Costanza wrote:
>
>>
>> On 9 Sep 2008, at 15:13, james anderson wrote:
>>
>>>> What do you want to achieve? In most cases, there are easier ways
>>>> than make-method-lambda to achieve what you want...
>>>
>>> manipulate the arguments passed to the method.
>>
>>
>> (defmacro define-manipulated-method (name (&rest args) &body body)
>>  (let ((unspecialized-args (extract-lambda-list args)))
>>    `(defmethod ,name ,args
>>       (apply (lambda ,unspecialized-args ,@body)
>>         (manipulate-args
>>           (list ,@(loop for arg in unspecialized-args
>>                         unless (member arg lambda-list-keywords)
>>                         collect arg)))))))
>>
>> ?!?
>>
>>
>> Pascal
(Continue reading)

james anderson | 9 Sep 18:51

Re: make-method-lambda ?

because it's another thing for the developer to keep track of.

On 2008-09-09, at 12:26 , Pascal Costanza wrote:

> why?
>
> On 9 Sep 2008, at 16:19, james anderson wrote:
>
>> i was hoping to avoid define-manipulated-method.
>>
>> On 2008-09-09, at 09:52 , Pascal Costanza wrote:
>>
>>>
>>> On 9 Sep 2008, at 15:13, james anderson wrote:
>>>
>>>>> What do you want to achieve? In most cases, there are easier ways
>>>>> than make-method-lambda to achieve what you want...
>>>>
>>>> manipulate the arguments passed to the method.
>>>
>>>
>>> (defmacro define-manipulated-method (name (&rest args) &body body)
>>>  (let ((unspecialized-args (extract-lambda-list args)))
>>>    `(defmethod ,name ,args
>>>       (apply (lambda ,unspecialized-args ,@body)
>>>         (manipulate-args
>>>           (list ,@(loop for arg in unspecialized-args
>>>                         unless (member arg lambda-list-keywords)
>>>                         collect arg)))))))
>>>
(Continue reading)

Pascal Costanza | 9 Sep 19:11

Re: make-method-lambda ?

You have to keep track of that anyway. The semantics of define- 
manipulated-method is sufficiently different from (standard) defmethod  
that it warrants using different names to make that distinction  
explicit. The idea of make-method-lambda is that you can use methods  
defined using defmethod interchangeably with different semantics in  
different contexts/generic functions, but it's actually very unlikely  
that a change of semantics (the fact whether the arguments are  
manipulated or not in your example) will _not_ have an effect on the  
method body. So if you have to change the method body because of  
different semantics, you might as well change the defining construct.

The advantage is that your code is more explicit. I think that makes  
it easier to keep track of things, not harder.

We wanted to include such a discussion in the paper, but we haven't  
gotten to a full formulation of the issues involved yet...

Pascal

On 9 Sep 2008, at 18:51, james anderson wrote:

> because it's another thing for the developer to keep track of.
>
> On 2008-09-09, at 12:26 , Pascal Costanza wrote:
>
>> why?
>>
>> On 9 Sep 2008, at 16:19, james anderson wrote:
>>
>>> i was hoping to avoid define-manipulated-method.
(Continue reading)

james anderson | 10 Sep 10:41

Re: make-method-lambda ?


On 2008-09-09, at 13:11 , Pascal Costanza wrote:

> You have to keep track of that anyway. The semantics of define-
> manipulated-method is sufficiently different from (standard) defmethod
> that it warrants using different names to make that distinction
> explicit.

my experience has been, that this distinction is academic and can be  
less useful in practice than on paper.
circumstances vary.

> The idea of make-method-lambda is that you can use methods
> defined using defmethod interchangeably with different semantics in
> different contexts/generic functions, but it's actually very unlikely
> that a change of semantics (the fact whether the arguments are
> manipulated or not in your example) will _not_ have an effect on the
> method body.

i am concerned with a case where there is to be no effect. that's the  
point of it.

> So if you have to change the method body because of
> different semantics, you might as well change the defining construct.

moot.

>
> The advantage is that your code is more explicit. I think that makes
> it easier to keep track of things, not harder.
(Continue reading)

Pascal Costanza | 10 Sep 15:58

Re: make-method-lambda ?


On 10 Sep 2008, at 10:41, james anderson wrote:

> On 2008-09-09, at 13:11 , Pascal Costanza wrote:
>
>> You have to keep track of that anyway. The semantics of define-
>> manipulated-method is sufficiently different from (standard)  
>> defmethod
>> that it warrants using different names to make that distinction
>> explicit.
>
> my experience has been, that this distinction is academic and can be
> less useful in practice than on paper.
> circumstances vary.

Don't call me academic! ;)

>> The idea of make-method-lambda is that you can use methods
>> defined using defmethod interchangeably with different semantics in
>> different contexts/generic functions, but it's actually very unlikely
>> that a change of semantics (the fact whether the arguments are
>> manipulated or not in your example) will _not_ have an effect on the
>> method body.
>
> i am concerned with a case where there is to be no effect. that's the
> point of it.

I find it hard to imagine that you need such strong weapons then.

Wouldn't a user-defined method combination that modifies arguments in  
(Continue reading)


Gmane