Re: Functions or templates? My rules of thumb

It’s true that if you’re going to immediately query into or re-process the nodes you’ve just created then you’ll want to be able to get at them through a function. I seem to remember that in FXSL you do that with the wrappers you use around sequences-of-sequences?

But in the majority of transformations, new nodes will be composed with element constructors rather than being used in expressions or patterns, so there’s no requirement to use a function to create them. (That’s not to say that you can’t then re-process the nodes, just that the nodes get stored in a temporary tree first.)

Anyway, these are just my rules of thumb, made to be broken (the rules, that is, not my thumbs).

Reply

The content of this field is kept private and will not be shown publicly.