Last modified: 2009-06-29 13:58:49 UTC
If I correctly understand how the parser works, parameters for parser functions are parsed _before_ they are passed to parser function hooks. This seems awfully wasteful, especially for #switch and different flavours of #if, where big chunks of code, including metatemplates, are often parsed and thrown away. Parsing could be left up to the hook functions to do as needed, preferably with a new way to set such hooks, so that the current extensions don't get broken.
The simplest solution may be to add a magic word to defer parsing until later; i.e. {{#myfn:{{first}}|{{defer:second}}}} would parse first before the function is called, and second after. Although I'm not quite sure how to add a new magic word, I was able to test this by recycling an existing magic word, and it seems to work.
*** Bug 9439 has been marked as a duplicate of this bug. ***
This behaviour was totally changed when the new preprocessor was implemented in 2008.