Template Macros, Initial Release
Template Macros are a new Racket library that dramatically simplifies the generation of meta-program code.
Template Macros are a new Racket library that dramatically simplifies the generation of meta-program code.
Docs for the template package are coming together nicely. Architectural details are starting to jump off the page and I’m slowing down to fold them into the code before the initial release announcement.
I’ve decided to make a serious effort this year to start using this blog as a project catalog and public relations vehicle. There should be at least one place on the Internet I can point to as a portfolio that isn’t GitHub. So, in that spirit, here’s what the next few months are starting to look like.
Generating rackunit tests with Racket macros is an easy way to improve the quality of your unit tests and your unit testing experience. Macros not only save you the time and energy of writing boilerplate, but also allow you to customize how tests are specified.
So what’s the catch?
rackunit’s basic checks are, by and large, functions. They raise run-time errors when they fail, and run-time errors report the source locations of their call sites. In tests generated by purely pattern-based macros, these locations point inside the macro definitions. Giving useful source locations to macro-generated tests takes a little more work.