Lisp HUG Maillist Archive

defsystem

I'm using defsystem for the first time to clean up and describe a largish 
project.  Evidence suggests that I'm not describing the dependencies 
correctly (i.e. I get unbound errors for variables that should have been 
loaded before something else).  I suspect that I'm rtfm'ing through 
makefile-coloured eyes and am missing something obvious.

My problem in the small: 5 .lisp files.  Macro.lisp contains a simple macro 
for defining constants.  Const.lisp and Opcodes.lisp use this macro to 
define constants.  Emit.lisp and assemble.lisp use the constants, i.e.

1) compile and load macro
2) then, compile and load const and opcodes
3) then, compile and load emit and assemble.

My description below works if I blow away all of the .fsl files, but didn't 
appear to work when I'd made a typo and then did a minimum recompile 
(unbound variables at runtime).  I tried to trick defsys into causing a 
full recompile by editing "macro.lisp" (1), but the problem persisted until 
I blew away the .fsl files again.

(defmacro subdir (s) (concatenate 'string *path* s))
....
(defsystem bytecoder (:default-pathname (subdir "bytecoder"))
   :members ("macro" "const" "opcodes" "emit" "assemble")
   :rules ((:in-order-to :compile ("const" "opcodes")
             (:requires (:load "macro"))
             (:caused-by (:compile "macro")))
           (:in-order-to :compile ("emit" "assemble")
            (:requires (:load "macro" "const" "opcodes"))
            (:caused-by (:compile "const" "opcodes")))))

thanx for any suggestions
pt


Re: defsystem

----- Original Message ----- 
From: Paul Tarvydas <tarvydas@attcanada.ca>


|...snip...|
| 
| (defmacro subdir (s) (concatenate 'string *path* s))
| ...
| (defsystem bytecoder (:default-pathname (subdir "bytecoder"))
|    :members ("macro" "const" "opcodes" "emit" "assemble")
|    :rules ((:in-order-to :compile ("const" "opcodes")
|              (:requires (:load "macro"))
|              (:caused-by (:compile "macro")))
|            (:in-order-to :compile ("emit" "assemble")
|             (:requires (:load "macro" "const" "opcodes"))
|             (:caused-by (:compile "const" "opcodes")))))
| 

I'd suggest indicating explicitly how to LOAD files as follows:

(defsystem bytecoder (:default-pathname (subdir "bytecoder"))
    :members ("macro" "const" "opcodes" "emit" "assemble")
    :rules ((:in-order-to :compile ("const" "opcodes")
              (:requires (:load "macro"))
              (:caused-by (:compile "macro")))
             (:in-order-to :load ("const" "opcodes")
              (:requires (:load "macro"))
              (:caused-by (:compile "macro")))

            (:in-order-to :compile ("emit" "assemble")
             (:requires (:load "macro" "const" "opcodes"))
             (:caused-by (:compile "const" "opcodes")))
            (:in-order-to :load ("emit" "assemble")
             (:requires (:load "macro" "const" "opcodes"))
             (:caused-by (:compile "const" "opcodes")))))
---
Sincerely,
Dmitri Ivanov
www.aha.ru/~divanov 



Re: defsystem

Unable to parse email body. Email id is 484

Updated at: 2020-12-10 09:01 UTC