From: Jesse
Subject: How to represent Church Numerals by Lambda calculus?
Date: 
Message-ID: <cyen.713460550@ponder>
The Church Numerals are defined:
0'=lambda f.lambda x.x
1'=lambda f.lambda x.f x
2'=lambda f.lambda x.f (f x)
......

n'=lambda f.lambda x.f^n x

Thus adding two Church Numerals:

add=lambda m.lambda n.lambda f.lambda x.m f (n f x)

m,n are Church Numerals

My problem is: how to define mult, which multiplies two Church Numerals m,n.

All I know is to add(n,n) up to m times, suppose n<m. (to prevent that m=0')

I have found some reference to define mult using mathematic representation,
but I have trouble transfering to lambda expression.

If you have any good idea or if you can make it in lisp, please e-mail to me.

I will post summary if I get the correct result. Thank you!

Jesse
e-mail: ····@cs.unt.edu

From: Clinton Hyde
Subject: having a tiny prob with CLOS
Date: 
Message-ID: <CHYDE.92Aug10150355@pecos.ads.com>
i have a method I want to remove. to do so, I need to find it with
find-method, but i haven't been able to figure out what FIND-METHOD
really wants as args.

here's CLtL2:

(find-method generic-fn qualifiers specializers)

here's an example:

(find-method (ensure-generic-function my-method-name) NIL '(t))

but this doesn't work. in Allegro CL, I get an error "the generic
function #<... my-method-name> does not have a method with qualifiers
NIL and specializers T". variations on this don't appear to work
either. i have NO qualifiers, so I believe NIL to be ok. presumably
it's my specializers list which is bad, but why?

my-method-name only takes one arg.

any assistance will be substantially helpful. I mean, I can always
reboot my lisp process, which will certainly eliminate the offending
method, but that's only a temporary fix. I just want this one method
punted...

please reply direct...

 -- clint
--

Clint Hyde		"Give me a LispM or give me death!" -- anonymous

Advanced Decision Systems	Internet:  ·····@chesapeake.ads.com
2111 Wilson Blvd #800
Arlington, VA 22201		(703) 875-0327
From: Gregor Kiczales
Subject: Re: having a tiny prob with CLOS
Date: 
Message-ID: <GREGOR.92Aug12133951@tracer-bullet.parc.xerox.com>
In article <···················@pecos.ads.com> ·····@pecos.ads.com (Clinton Hyde) writes:

   From: ·····@pecos.ads.com (Clinton Hyde)
   Date: 10 Aug 92 20:03:55 GMT

   i have a method I want to remove. to do so, I need to find it with
   find-method, but i haven't been able to figure out what FIND-METHOD
   really wants as args.

   (find-method (ensure-generic-function my-method-name) NIL '(t))

   but this doesn't work.

The specializers have to be "specializers" not "specializer names."  The
AMOP makes this distinction more clear than it is in CLtLII.  So, you can
fix this case by saying:
  
  (find-method #'foo
               ()
               (mapcar #'find-class '(t)))


Another way that is often much easier, especially in the common case
where there are only a few methods on the generic function, is to grovel
through the result of GENERIC-FUNCTION-METHODS.  Like this:

(defmethod f1 ((x foo)) ..)
#<Method F1 (FOO) ..>
(defmethod f1 ((x bar)) ..)
#<Method F1 (BAR) ..>

(generic-function-methods #'f1) 
(#<Method F1 (BAR) ..> #<Method F1 (FOO) ..>)

(remove-method #'f1 (cadr *))  ; this removes the method specialized to FOO