[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Condor-devel] RFC: an implementation of classads enhanced with macro evaluation
- Date: Sun, 11 Mar 2012 12:37:44 -0700
- From: Erik Erlandson <eje@xxxxxxxxxx>
- Subject: [Condor-devel] RFC: an implementation of classads enhanced with macro evaluation
I have been fooling around with an implementation of the ClassAd 2.4
language spec, and I came up with a surprisingly clean extension to the
language that provides macro evaluation at parse time, with the full
ClassAd "evaluation in context" eval() semantics behind it.
An interesting use case for this extension is that it would allow a
system to be configured using classads. For example, in theory condor
could be configured using the same classad system that it already uses
for all its other data.
A short example of using macros in a classad can be seen here:
https://github.com/erikerlandson/classad_pl/blob/feat/macro-op/examples/x06_macros.pl#L1
(If you happen to notice that this implementation is in Prolog, do not
be alarmed -- everything about this implementation and its interface
could be ported to something like ANTLR and give it internal
representations for C++, python, ruby, etc).
You can see how macros are implemented at the parsing layer here:
https://github.com/erikerlandson/classad_pl/blob/feat/macro-op/lib/classad_parser.pl#L176