Chapter 34. Nested Function
Compose functions by nesting function calls as arguments of other calls.
34.1 How It Works
By representing a DSL clause as a Nested Function, you’re able to reflect the hierarchic nature of the language in a way that’s mirrored in the host language, not just in a formatting convention.
A notable property of Nested Function is the way it affects the evaluation order of its arguments. Function Sequence and Method Chaining both evaluate the functions in a left-to-right sequence. Nested Function evaluates the arguments of a function before the enclosing function itself. I find this most memorable with the “Old MacDonald” ...
Get Domain Specific Languages now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.