Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace TwiML macros with Macro.postwalk/2 #8

Merged
merged 2 commits into from
Sep 12, 2015
Merged

Conversation

danielberkompas
Copy link
Owner

It isn’t necessary to generate a macro for each Twilio verb. The library
can have less code (and clearer code!) by using
Macro.postwalk/2 to expand all the verbs in the AST into tag and
text calls.

This gives the illusion that there is a macro for each TwiML verb, but
without having to actually define one. Plus, the transformation from verb
to the tag macro is better defined and commented now.

This PR also removes the option macro, since I doubt anyone is using it, and
it unecessarily complicates things.

It’s better to let the user of the library figure out how to keep track
of which options were presented to the user than provide this API. It
just complicates the implementation at this point. Therefore, removed!
It isn’t necessary to generate a macro for each Twilio verb. The
library can have less code (and clearer code!) by using
`Macro.postwalk/2` to expand all the verbs in the AST into `tag` and
`text` calls.

This gives the illusion that there is a macro for each TwiML verb, but
without having to actually define one. Plus, the transformation from
verb to the `tag` macro is better defined and commented now.
danielberkompas added a commit that referenced this pull request Sep 12, 2015
Replace TwiML macros with `Macro.postwalk/2`
@danielberkompas danielberkompas merged commit 22187b0 into master Sep 12, 2015
@danielberkompas danielberkompas deleted the remove-macros branch September 12, 2015 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant