Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!news.cs.indiana.edu!purdue!yeh From: yeh@cs.purdue.EDU (Wei Jen Yeh) Newsgroups: comp.lang.lisp Subject: compiling lambda-CLOSUREs Keywords: was monitoring functions Message-ID: <14172@medusa.cs.purdue.edu> Date: 3 Apr 91 10:33:26 GMT Sender: news@cs.purdue.EDU Organization: Department of Computer Science, Purdue University Lines: 36 Hello again, Regarding the wrapper function that I asked, this is the final version that I used. (Thanks again to Barry and the person for pointing out using multiple-value-prog1.) (defun monitor_1fun (fname) (if (fboundp fname) (if (get fname 'monitored) (format T "Function ~A is already being monitored." fname) (let ((old_fun (symbol-function fname))) (setf (get fname 'monitored) old_fun) (setf (symbol-function fname) #'(lambda (&rest args) (start_bench fname) (multiple-value-prog1 (apply old_fun args) (end_bench fname)))) ; (compile fname) (setq *Monitor_List* (cons fname *Monitor_List*)) *Monitor_List*)) (format T "function ~A is not defined." fname))) However, the commented compile call failed. Is there any reason (both in theory/implementation) why a lambda-closure cannot be compiled? Why doesn't the standard (ep, ip) trick work? I'm looking forward to the wisdom from you guys... Wei Jen Yeh yeh@cs.purdue.edu Department of Computer Science Purdue University West Lafayette, Indiana -- Wei Jen Yeh yeh@cs.purdue.edu Department of Computer Science Purdue University West Lafayette, Indiana