Skip to content

Commit 3114a38

Browse files
committed
Add Expose Internal Representation as an elixir til
1 parent 142811f commit 3114a38

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ variety of languages and technologies. These are things that don't really
77
warrant a full blog post. These are mostly things I learn by pairing with
88
smart people at [Hashrocket](http://hashrocket.com/).
99

10-
_333 TILs and counting..._
10+
_334 TILs and counting..._
1111

1212
---
1313

@@ -66,6 +66,7 @@ _333 TILs and counting..._
6666
### Elixir
6767

6868
- [Append To A Keyword List](elixir/append-to-a-keyword-list.md)
69+
- [Expose Internal Representation](elixir/expose-internal-representation.md)
6970
- [Replace Duplicates In A Keyword List](elixir/replace-duplicates-in-a-keyword-list.md)
7071

7172
### Git
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Expose Internal Representation
2+
3+
Elixir is a language that has strong support for metaprogramming. It
4+
provides easy access to an internal representation of the code in the form
5+
of an Abstract Syntax Tree (AST) using maps and keyword lists. The `quote`
6+
function is used to expose this internal representation.
7+
8+
```elixir
9+
> quote do: 2 * 2
10+
{:*, [context: Elixir, import: Kernel], [2, 2]}
11+
> quote do: 2 * 2 == 4
12+
{:==, [context: Elixir, import: Kernel],
13+
[{:*, [context: Elixir, import: Kernel], [2, 2]}, 4]}
14+
```
15+
16+
[source](http://elixir-lang.org/getting-started/meta/quote-and-unquote.html)

0 commit comments

Comments
 (0)