Re: "Macro" expansion

Matt Holgate <[email protected]> Mon, 28 May 2001 11:21:35 +0100 (BST)
Newsgroups gmane.comp.sysutils.ark.devel
Message-ID <[email protected]>
On Sun, 27 May 2001, Jonathan Hogg wrote:

> On 27/5/01 21:38, Matt Holgate wrote:
>
> >@<object-type|param>:<field-name>[:<index>[:<separator>]]@
>
> OK, I liked what Matt said, so I went ahead and implemented it. To keep
> backwards compatibility though, I put in a hack for "package:indexed".
> I'm not sure where that should fit into your schema Matt.

I guess the thing to do would be to replace:

@package:indexed:foo@

with something like:

@package:foo:__proto_host__@

we could also have, __proto_package__, __proto_user__, __proto_blah__ etc.

> I extended your schema slightly so that '*:<delim>' can be used for
> tables too (it separates the table values in arbitrary order). I've also
> added a new 'type' called "self", which represents the thing being
> evaluated (not always a 'package').

Cool!

> I think there is some conceptual horror lying in this somewhere that Will
> will hopefully point out for me...

One thing I thought of is the possibility of cycles eg.

<host>
 <foo>@package:bar@</foo>
</host>

<package>
  <bar>@host:foo@</bar>
</package>

> The regex I'm using to find the '@...@' stuff is smart enough to see that
> '@host:run-level-dir:@' is a bad spec so it skips it and matches the
> '@param:RUN_LEVEL@' one. Having replaced it, it looks again and finds
> '@host:run-level-dir:3@' (or whatever) and successfully matches it.

Funky!! But will it break with this case:

@host:run-level-dir:*:@param:sep@@

??

Nice work, Jonathan!

Matt