pragdave/mdef — pull request #2 by DevL (2014-11-30 14:41:32+00:00)
Title: Add mdefp macro to generate private functions

Adds a mdefp macro for generating private functions.
Also bumps the requirements to Elixir 1.0 and bumps the version to 0.3.0.

This is a start, but I've run into a snag when it comes to figuring out a sane way to DRY the macros without adding a private function that pollutes the module the macros are used in. I'm having a hard time fully wrapping my head around Elixir's macros compared to the meta-programming I'm used to coming from Ruby-land. Ideally, I'd like to split the macros into several smaller macros with intention-revealing names that can be used to avoid duplication and pyramid of doom and unreadability going on here.

I believe `defmacrop` can be used to good effect, but I can't seem to figure out how to pass on the parameters from a macro to another without getting lost in a maze of quoting and unquoting. Any ideas and pointers are most welcome!