Balazs Scheidler <bazsi77@gmail.com> writes:
dbparser: Make the context length available to action conditions
I didn't pick this one. I was thinking about using a template function to return the number of entries in the current context.
Indeed, using a template function crossed my mind too, but to do that, I would have to do a dance I deemed too expensive, both by the amount of code that would need to be written and the number of hoops the template function would have to jump through: it would need to be called first, then look up the context, then append the string to the result.. That seemed overly complicated to me, compared to the few lines the patch adds.
You don't have to look up anything, the context is passed to template functions through the invoke args stuff. There are already template functions that use the context, see for instance $(grep)
I've implemented $(context-length) now, it's pushed to the merge-queue/3.4 branch. It was easier than I thought, and more straightforward than the previous $CONTEXT_LENGTH thing, too. -- |8]