[Openmcl-devel] DEFUN inside LET (was: Thread-local bindings)

Robert Munyer 2420506348 at munyer.com
Sun Jun 16 14:52:40 PDT 2019

Ron Garret wrote:

> (let ((lock (make-lock))
>   (defun out (s &rest args)
>     (with-lock-grabbed (lock)

I'd like to hear everyone's opinion about this construct.

My own opinion of it is still inchoate.  I use it in unpublished CCL-only
programs, especially if I'm doing Hoare-style concurrent programming, but
I add a "TO DO" comment saying "before publishing this or porting it to a
different compiler, find out if it's really OK that these DEFUN forms are
not top-level forms".

I haven't done any multi-threaded programming using any CL compiler other
than MCL/OpenMCL/CCL.

The best on-line discussion about this construct that I've found is a
comp.lang.lisp thread that was started by R. Matthew Emerson in October
1998 (message id "<6v6l3c$d8j$1 at news-2.news.gte.net>", subject "defun
within let").

More information about the Openmcl-devel mailing list