gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: GCL compilation in the background


From: Camm Maguire
Subject: [Gcl-devel] Re: GCL compilation in the background
Date: 01 Nov 2005 17:47:13 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!

Robert Boyer <address@hidden> writes:

> > How about this:
> 
> Your implementation does not satisfy the property that it leaves me alone in
> my current GCL to continue work.  It also does not satisfy the property that
> it generates an output file name based upon the file being compiled.  I think
> that the following is what I want.
> 

Great!  Seems like this could really be integrated into a "parallel
make aka make -j" in a lisp defsystem implementation.  Thanks!  I'll
try putting something like this into gcl_cmpmain.lsp if you don't
mind. 

> Really cool stuff, this fork command.  Thank you!
> 
> Bob
> 
> (defun eval-and-ignore-in-the-background (form)

Just wanted to mention that this macro is currently closely akin to
the si::background macro.  The question of error handling in the child
is a good one deserving some pondering.  Hmmm... :-).  Doing this as a
macro though lets one skip the eval and execute compiled code inline.

Take care,

>    (let ((pair (si::fork)))
>       (cond ((= (car pair) 0)
>            ;; So here we are in the child process.  Fortunately, we
>            ;; already have the form to eval at hand, don't need any
>            ;; I/O, and so we just eval it and quit.
>            (ignore-errors (eval form))
>            ;; ignore-errors avoids going into the debugger
>            (bye))
>           (t
>            ;; But here we are in the parent process.  The child is
>            ;; merrily running in the background, we trust, so we
>            ;; simply return the process id of the child in case
>            ; anyone cares.
>            (car pair)))))
> 
> (defun compile-these-files-in-the-background (l)
>   (loop for x in l
>       do
>       (cond ((not (stringp x)) (error "Not a string: ~a." x))
>             ((probe-file x)
>              (eval-and-ignore-in-the-background
>                 `(with-open-file (s (concatenate 'string ,x
>                                                      ".compiler-output.text")
>                                         :direction :output
>                                         :if-exists :rename-and-delete)
>                        (let ((*standard-output* s))
>                          (compile-file ,x)))))
>             (t (error "No such file: ~a." x)))))
>   
> (defun test ()
>   (compile-these-files-in-the-background
>    '("foo1.lisp" "foo2.lisp" "foo3.lisp")))
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]