Re: lw:defsystem rule (:in-order-to :load ... (:caused-by (:load ...))
* "Dmitriy Ivanov" <000d01c9b1ea$86013720$8100a8c0@digo> :
Wrote on Tue, 31 Mar 2009 14:21:49 +0400:
| (defsystem YHTML ()
| :members
| (...
| "elements"
| "htmlgen"
| ("phtml" :features :phtml)
| ("lhtt" :features :phtml) ...)
| :rules
| (...
| (:in-order-to :compile "lhtt"
| (:requires (:load "elements" "htmlgen" "phtml")))
| (:in-order-to :load "lhtt"
| (:caused-by (:load "elements" "htmlgen"))
| (:requires (:load "elements" "htmlgen" "phtml")))
| ...))
|
| The scenario is simple. After everything is compiled and loaded, I
| alter the htmlgen.lisp source file. Then I try to compile and load the
| system again. In the System Browser on the Preview tab, I tick both
| Compile and Load and press the Recompute Events button.
|
| It shows Compile htmlgen.lisp and Load htmlgen.fsl under the
| Plan. Nothing about lhtt! Evaluating
| (compile-system 'YHTML :load t)
| in the Listener confirms this plan. lhtt.fsl is not loaded. IMHO, the
| above rule should prescribe this.
|
| Should the :caused-by clause work for the :load action as well as for
| :compile? Am I wrong? (I am on LWW4.6)
Earlier, I had assumed that the answer was `no'; the after-the-fact
reasoning I adduced was that the `compile' and `load' actions on the
system are decoupled by default: and that implicit rules only specify
that a member is added to a plan if it is changed it; and so I had
always assumed that the system needed an explicit rule to trigger
recompilation of "lhtt" when "elements" or "htmlgen" was recompiled.
However on reading section 17.2.4 "DEFSYSTEM rules" of the LW user
guide,
</lw511/lib/5-1-0-0/manual/online/web/LWUG/html/lwuser-247.htm>
,----
| When you invoke an action such as compiling a system, the following
| happens by default:
|
| Each member of the system is considered in turn, in the order they are
| given in the system definition.
|
| If the member is a file and action-specific constraints are satisfied,
| the file action is inserted into a plan .
[...]
| When the action and member of a target are matched during the traversal
| of the list of members, the target is inserted into the plan if either
| of the following are true:
|
| - any of the action-member descriptions in the :caused-by clause is
| already in the plan, or
|
| - any implicit conditions (such as the source file being newer than the
| object file) are satisfied.
`----
I'd agree that you are not wrong in your expectation: During the `load'
action, when considering the member "lhtt", we already have
(LOAD [object] "htmlgen") in the plan.
This matches the action-description in the :caused-by clause and so
(LOAD "lhtt")
ought to be included in the plan.
So in my reading of the description in LWUG, this would be a bug.
--
Madhu