Re: FLET vs LABELS

From: Alex Mizrahi (udodenko_at_hotmail.com)
Date: 01/15/05


Date: Sat, 15 Jan 2005 01:20:49 +0200


(message (Hello 'Trent)
(you :wrote :on '(Fri, 14 Jan 2005 22:39:00 GMT))
(

 TB> This brings up another question that occured to me recently: how does
 TB> one define a recursive, anonymous function?

using Y operator, for example:

(defun Y (f)
   ( (lambda (g) (lambda (h) (funcall (funcall f (funcall g g)) h)))
      (lambda (g) (lambda (h) (funcall (funcall f (funcall g g)) h)))))

(funcall (Y (lambda (myself) (lambda (n) (if (zerop n) 1 (* n (funcall
myself (- X 1))))))) 10)

or if you don't mind using labels and macros, there are other ways..
see discussion http://tinyurl.com/4ufwo

)
(With-best-regards '(Alex Mizrahi) :aka 'killer_storm)
(prin1 "People, who lust for the Feel of keys on their fingertips (c)
Inity"))