Path: utzoo!mnetor!uunet!husc6!bbn!rochester!daemon From: miller@ACORN.CS.ROCHESTER.EDU (Brad Miller) Newsgroups: comp.lang.lisp Subject: Re: Compiling lexical closures Message-ID: <9359@sol.ARPA> Date: 4 May 88 18:51:10 GMT Sender: daemon@cs.rochester.edu Lines: 39 Date: 2 May 88 16:28:55 GMT From: bernat@utep-vaxa.UUCP (Dr. Bernat ) I am trying to compile a lexical closure in Franz Common LISP and keeping getting the "illegal function form" message. It seems to me that I should be able to compile closures. For example, (defun test (a) (function (lambda (x) (cons x a)))) (test 5) => returns a lexical closure (funcall (test 5) 6) => (6.5) as expected but (compile nil (test 5)) gives the error message Can anyone help? Thanks, Andrew Bernat CS Dept. U.Texas @ El Paso UUCP ...ut-sally!utep-vaxa!bernat BITNET BJ00@UTEP 915/747-5470 Try redefining test to: (defun test (a) (compile nil `(lambda (x) (cons x ,a)))) The problem is that compile doesn't know what to do with a closure, you have to compile the lambda form. [I don't have a franz common lisp, this follows from Steele, and works on a Symbolics] ---- Brad Miller U. Rochester Comp Sci Dept. miller@cs.rochester.edu {...allegra!rochester!miller}