Path: utzoo!attcan!uunet!cs.utexas.edu!hellgate.utah.edu!cdr.utah.edu!moore From: moore%cdr.utah.edu@cs.utah.edu (Tim Moore) Newsgroups: comp.lang.lisp Subject: Re: A Scheme -> CL conversion question. Keywords: Scheme Message-ID: <1990Nov12.095731.7500@hellgate.utah.edu> Date: 12 Nov 90 16:57:31 GMT References: <.658347415@boojum> Organization: University of Utah CS Dept Lines: 30 In article <.658347415@boojum> misha@BOOJUM.HUJI.AC.IL (Michael Pak) writes: >Hello there, gurus of Scheme AND Common Lisp. > > How do you write the following Scheme code in Common Lisp: > >------- cut here -------- >(define (foo func) > (lambda (bar) (func (func (func bar)))))) > >((((foo foo) foo) 1+) 0) ;See the spoiler at the end to see what does > ; this cute little thing return... >------- cut here ------- (defun foo (func) #'(lambda (bar) (funcall func (funcall func (funcall func bar))))) (funcall (funcall (funcall (foo #'foo) #'foo) #'1+) 0) >I have tried many ways to implement this in Common Lisp, but every time >it says that something else is wrong. I have just begun studying Common Lisp, >and this thing was the first I wanted to try. > This is good example of an program which can be expressed more compactly in Scheme than in Common Lisp. Tim Moore moore@cs.utah.edu {bellcore,hplabs}!utah-cs!moore "Ah, youth. Ah, statute of limitations." -John Waters