should 'things' have a magic 'ALL' field?
Will Partain <[email protected]> Sat, 28 Jul 2001 21:34:47 +0100
| Newsgroups | gmane.comp.sysutils.ark.devel |
|---|---|
| Message-ID | <[email protected]> |
OK, folks, thinking-caps-on time... This is a question
about adding something to the ARK engine.
I'll use a 'package' example but there's nothing
package-specific, really. Imagine you have a <package
name="xemacs--21.5"> (a 'thing') with
<prototype team="op" name="xemacs" />
In <your-site>/package/xemacs--21.5.xml, you have
<compile>
<param name="CC"> gcc </param>
<param name="CFLAGS"> -O3 </param>
</compile>
and in the proto-package op/package/xemacs.xml, you have
<compile>
<param name="CC"> cc </param>
<param name="CFLAGS"> -g </param>
</compile>
<install>
<param name="CC"> cc </param>
<param name="CFLAGS"> -g </param>
</install>
Should you ask the ARK engine, "please look up the field
<compile> for the object xemacs--21.5", the params CC and
CFLAGS will be set from xemacs--21.5, and the param values
in the prototype will be overridden, effectively.
Had you asked for the <install> field instead, you would get
the param values (cc and -g) from the prototype.
This is core ARK behavior.
Notice that all fields (<compile> vs <install>) are
independent of each other. If both fields need to be fed
the same info (dependencies, for example), you gotta specify
it twice or more.
So: would there be any value to a magic <ALL> field? I
guess it couldn't have a value (string,table,list,code),
but it could set <param>s and <constraint>s, and perhaps
other stuff.
In a case like the one above, you would write
<ALL>
<param name="CC"> gcc </param>
<param name="CFLAGS"> -O </param>
</ALL>
and then you wouldn't (need to) set these <param>s at all in
individual fields (<compile>, <install>, etc.)
The semantics would be: The <ALL> field would be looked up
in the normal way -- following prototype links and all.
Whatever you picked up from the <ALL> field are injected
into the proceedings immediately before the value
(string,table,list,code). In the typical case, think of it
as coming after the last <param> before you hit the <code>.
A magic <ALL> field would definitely remove some unsightly
duplication. I worry that it is too ugly for words and a
complication too far... Anyone got a view?
Will