File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 40
40
" <div><h1 class=\" title\" >Hello</h1><p>Metaprogramming Elixir</p></div>"
41
41
```
42
42
43
- </details >
44
-
45
- <details >
46
- <summary >The Abstract Syntax Tree</summary >
43
+ #### The Abstract Syntax Tree
47
44
48
45
- Most languages use AST but you never need to know about them. They are used typically during compilation
49
46
or interpretation to transform source code into a tree structure before being turned into bytecode
@@ -68,10 +65,7 @@ iex> quote do: div(10, 2)
68
65
- The purpose of macros is to interact with this AST with the syntax of Elixir.
69
66
- Macros turn you from language consumer to language creator. You have the same level of power as José when he wrote the standard library.
70
67
71
- </details >
72
-
73
- <details >
74
- <summary >Trying It All Together</summary >
68
+ #### Trying It All Together
75
69
76
70
"Let's write a macro that can print the spoken form of an Elixir mathematical expression, such as 5 + 2, when calculating a result.
77
71
In most languages, we would have to parse a string expression into something digestible by our program. With Elixir, we can access
You can’t perform that action at this time.
0 commit comments