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

Re: defsystem ?

On Sun Jan  9,Peggy Eaton asks about defsystem:
   I'm interested in using a defsystem utility in MCL - I'm new
  to MCL so maybe one already exists -- I've tried porting Mark
  Kantrowitz's Defsystem (a portable Make Facility for Common
  Lisp) -- but after a couple of hours of foolin' with it I decided
  to ask around before messing with the code any further.  
  I have a pretty big set of modules to load and the nice thing
  about defsystem is being able to set dependencies.  Any suggestions?

You don't need to change the code itself.

The only problems I've had with defsystem are with the logical names.
Here's an example of the defsystem commands required to load the
the print-u code stored in the folder ccl:menu enhancements

(defsystem print-u
  :source-pathname (logical-to-name "CCL:" "menu enhancements:")
  :source-extension "lisp"
  :binary-extension "fasl"
  :binary-pathname (logical-to-name "CCL:" "menu enhancements:fasls:")
  :components ((:file "print-u"))
  :initially-do (progn (CCL::require-interface :printTraps)
                       (require :quickDraw)))

Here's the necessary code to define the logical name translation:

(defmacro logical-to-name (logical-name &optional rest)
  "Allow the expansion of logical pathnames"
  `(if ,rest
     (format nil "~a~a" (mac-directory-namestring 
                         (truename ,logical-name))
     (mac-directory-namestring (truename ,logical-name))))

Now for an example of how to define a logical name for the examples

(setf (logical-pathname-translations "Examples")
            (list (list (concatenate 'string "Examples:**;*.*")
                        (concatenate 'string "ccl:Examples;**;*.*"))))