[Openmcl-devel] Problem with the (:y nn) command

Ron Garret ron at flownet.com
Thu Apr 29 08:13:41 PDT 2021


If you are spawning processes in the GUI it is better to use gui:background-process-run-function rather than the regular process-run-function.

Here is a macro that I use to spawn processes.  It automatically dispatches to the correct function depending on the environment it’s running in, and also has a workaround for a small bug in the gui code:

(defmacro spawn (&rest body)
  (let ((name (mcond (stringp (car body)) (pop body)
                     (eq (car body) :name) (progn (pop body) (pop body))
                     t '(symbol-name (gensym "SPAWNED-TASK"))))
        (namevar (gensym "NAME"))
        (prf (or #+EASYGUI 'gui:background-process-run-function 'process-run-function)))
    `(let ((,namevar ,name))
       (prog1
           (,prf (list :name (princ-to-string ,namevar)) #+LISPWORKS nil (fn () , at body))
         #+EASYGUI (sleep 0.1) ; Workaround for race condition in gui:background-process-run-function
         ))))

On Apr 29, 2021, at 4:40 AM, barthes <barthes at utc.fr> wrote:

> Hi
> 
> I am trying to reproduce the example found in the Clozure documentation:
> 
> <Capture d’écran 2021-04-29 à 13.30.35.png>
> 
> 
> When executing this line a Clozure window appears:
> 
> <Capture d’écran 2021-04-29 à 13.30.03.png>
> 
> but I have no way of regaining control, i.e. nothing happens.
> 
> What should I do?
> 
> Is there a way to get rid of this window?
> 
> The MacOS on my machine is Mojave 10.14.6
> 
> 
> Thanks
> 
> J.Paul Barthès
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> https://lists.clozure.com/mailman/listinfo/openmcl-devel




More information about the Openmcl-devel mailing list