Closed Zooce closed 3 years ago
The more I think about this, the more I'm convinced that it aligns with the 1st goal of ZOMB files -- "No more unwieldy repetition."
The alternative in my original post is unaffected in this feature were to be added to ZOMB files, so you get both.
Completed by #5
Allow default macro parameter values like this:
Default parameter values are common in programming languages (for better or worse -- there are debates on this), and so I think in general it's pretty easy to see why this features might be useful. Now obviously the ZOMB file format is not a programming language, but default macro parameters would allow for less duplication, which is kind of the most important objective for ZOMB files.
As for implementations I don't think this feature would require much extra effort -- maybe an extra parameter count check and some logic to replace the default value of a parameter if a value was provided in the macro expression -- of course it depends on the implementation.
An alternative
This is already kind of achievable without default parameters, and in some ways I actually like this better because it's more explicit: