On Thu, 2010-10-28 at 15:10 -0400, Lars Kellogg-Stedman wrote:
What do you think? Would you like to implement such a functionality? I'd love to include that in the convertfuncs module in 3.2
I'd love to give it a shot. Let me take a look at the source with template functions in mind and see where I end up.
Great. You should possibly look at the simple ones (echo, ipv4-to-int, etc) first. Then you'll possibly need a a "prepare" callback in order to process the quite complicated argument list using GLib's option parser into structure that can then be passed to the core of the format functionality. The point of the prepare callback is to avoid having to do expensive parameter processing during runtime (when it is expensive) and do it early on during template compilation. Currently grep/if use this functionality to compile the filter expression into its internal representation. -- Bazsi