[Openmcl-devel] two ccl11 issues

Arthur Cater arthur.cater at ucd.ie
Fri Sep 30 15:03:33 UTC 2016


Hi, I’m trying to move over to Darwin CCL 11   from Darwin CCL 10.
I’m using a mid-2015 MacBook Pro with OS X El Capitan 10.11.5.
I started lisp in Terminal with   ./dx86cl64 —no-init
and then said    (require “COCOA”)

The first issue I want to mention is that, while preparing for the mention of
the second issue, I had a once-off weirdness as this screenshot shows:

The second is that my macro for writing messages to the listener window
misbehaves when used in the gui (main) thread. Here’s evidence:
lisp was started again, successfullyb this time, as described above, and code
was pasted into the listener window, and then three functions called in turn.
The one where the gui thread is used to execute the form produces no output.
In ccl10 there was no such problem with a very similar WRITEOUT macro, I’ve
simplified it very slightly for presentation here.

Welcome to Clozure Common Lisp Version 1.11-r16635  (DarwinX8664)!
? (in-package :cl-user)

(defmacro writeout (msg &rest args)
  (let ((p (gensym)))
    `(let ((,p (find 'gui::cocoa-listener-process (ccl::all-processes) :key #'type-of)))
       (if ,p
           (format (gui::cocoa-listener-process-output-stream ,p) ,msg , at args)))))

(defun test-in-listener ()
  (writeout "~%Writing in the listener.~%"))

(defun test-in-main ()
  (gui::execute-in-gui (lambda () (writeout "~&Writing in the gui.~%"))))

(defun test-in-another ()
  (ccl::process-run-function "A new process"
    (lambda () (writeout "~&Writing in a new process.~%")))
  (sleep 1))

#<Package "COMMON-LISP-USER">
? 
WRITEOUT
? 
TEST-IN-LISTENER
? 
TEST-IN-MAIN
? 
TEST-IN-ANOTHER
? ;;; The above was copied from a file and pasted into the listener all at once
;;; Now to test. Get a prompt ...
t
T
? (test-in-listener)

Writing in the listener.
NIL
? (test-in-main)
NIL
? (test-in-another)
Writing in a new process.
NIL
? 

— end of quoted output, resumption of email text —

The SLEEP btw is there just to avoid intermingling of the text output and the
function result, which otherwise is a process.

I can work around this by changing my WRITEOUT macro to always use a new
process to write its output, but this seems very heavyweight. I don’t understand
what’s changed in CCL to make the behaviour different from CCL10.

Help would be appreciated, as always!

Arthur

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clozure.com/pipermail/openmcl-devel/attachments/20160930/4584eb9f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2016-09-30 at 3.43.19 PM.png
Type: image/png
Size: 64840 bytes
Desc: not available
URL: <http://lists.clozure.com/pipermail/openmcl-devel/attachments/20160930/4584eb9f/attachment-0001.png>


More information about the Openmcl-devel mailing list