Bug with cocoa

Raffael Cavallaro <[email protected]> Sat, 11 Oct 2003 01:14:11 -0400
Newsgroups gmane.lisp.openmcl.bugs
Message-ID <[email protected]>
The following code runs fine from the command line version of OpenMCL 
(i.e., dppccl). Apologies for any hackishness - it's a simple benchmark 
of format:

(defun hanoi (x)
   "Prints the solution to the Towers of Hanoi puzze for x disks to std 
output."
   (declare (optimize (speed 3) (safety 0)) (fixnum x ))
   (let (( posts
           (cons (nreverse (append (cons 'bottom (loop for i from 2 to 
(1- x) collect i) ) (list 'top) )) '(nil nil)  ) ))
     (setf (nth 1 posts) nil)
     (setf (nth 2 posts) nil)
     (format t "         Initial conditions with ~a disks: => ~a~%"  x 
posts)
     (labels ((push-pop (source dest) (declare (fixnum source dest))
                (push (pop (nth (1- source) posts)) (nth (1- dest) 
posts)))

              (move-n-disks (n  source  dest  temp)
                (declare (optimize (speed 3) (safety 3)) (fixnum source 
dest temp n))
                (cond ((= n 1) (progn
                                 (format t "Moving disk ~a from post ~a 
to post ~a. =>  "  (first (nth (1- source) posts)) source dest)
                                 (push-pop source dest)
                                 (format t "~a~%" posts)))
                      (t (progn
                           (move-n-disks (- n 1)   source  temp  dest)
                           (move-n-disks  1  source dest temp)
                           (move-n-disks (- n 1)  temp  dest  
source))))))

       (move-n-disks x  1  2  3))))

When I execute (hanoi 9) from the command line version of OpenMCL, 
everything runs fine. However, if I execute (require 'cocoa) and the 
OpenMCL IDE launches, I can compile hanoi, but (hanoi 9) chokes, 
usually halfway through a line of output. I get the dread spinning 
beachball/optical-disk-of-death, and I must force quite OpenMCL. Again, 
this works just fine from the command line, and in MCL 5.0 as well, 
(and sbcl too, fwiw). It would seem to be a problem with the cocoa 
implemetation of format to standard output.

  I'm running OpenMCL Version (Alpha: Darwin) 0.14-030901.

regards,
Raf


Raffael Cavallaro, Ph.D.
[email protected]

_______________________________________________
bug-openmcl mailing list
[email protected]
http://clozure.com/cgi-bin/mailman/listinfo/bug-openmcl