Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!udel!princeton!phoenix!eliot From: eliot@phoenix.Princeton.EDU (Eliot Handelman) Newsgroups: comp.lang.lisp Subject: Self-referencing Closures Message-ID: <6859@phoenix.Princeton.EDU> Date: 6 Mar 89 20:01:06 GMT Reply-To: eliot@phoenix.Princeton.EDU (Eliot Handelman) Organization: Princeton University, NJ Lines: 20 The situation is this: a process, represented as a closure, spawns a child, another closure. The parent then runs the child, and when the child finishes it returns to the parent. I am doing this using continuations, that is, the child is passed the parent closure which it then funcalls when it has finished. So the parent has to be able to pass itself to the child. I can let a closure reference itself in the following way: (defun make-closure () (let (-self-) (setq -self- #'(lambda () )))) Does this seem like a particularly bad idea? Is there some important reason why I would not want to do this? Is there some reason why I wouldn't want to use SETQ? Can this be done more elegantly? All criticism welcome. Thanks, Eliot