Summary
In this chapter, we learned how Julia parses expressions into an abstract syntax tree structure. We learned that expressions can be created and evaluated programmatically. We also learned how to interpolate variables into quoted expressions.
Then, we jumped into the topic of macros, which are used to dynamically create new code. We learned that macro arguments are expressions rather than values, and learned how to create new expressions from macros. We had fun creating macros that manipulate the abstract syntax tree to deal with some interesting use cases.
Finally, we looked at generated functions, which can be used to generate code based on the type of the function arguments. We learned how generated functions can be useful for a ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access