Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Aggregate Function Definition #24
There are a few situations where you could have a series of functions that do the same thing with a minor variation. For example:
This code could be kept more DRY with the shared behavior abstracted into what I'm calling an "aggregate function definition":
For functions in an aggregate definition, statements that appear before that function will be prepended to the statements of the function, executing first when the function is called. Statements that appear after the function will be executed on return.