Skip to content

Instantly share code, notes, and snippets.

@marianoguerra
Created July 19, 2015 13:40
Show Gist options
  • Save marianoguerra/e0805f0b34513ba27a3c to your computer and use it in GitHub Desktop.
Save marianoguerra/e0805f0b34513ba27a3c to your computer and use it in GitHub Desktop.
-file("examples/use_macros.fn", 1).
-module(use_macros).
-export([main/0]).
-file("examples/ms.hrl", 1).
what_am_i() -> a_function_in_the_macro_file.
-file("use_macros.fn", 1).
main() ->
a_function_in_the_macro_file = what_am_i(),
"bob" = "bob",
2 * 3 = 2 * 3,
{"bob", bob} = {"bob", bob},
12 + 1 = 12 + 1,
42 * 5 + 2 * 3 = 42 * 5 + 2 * 3,
io:format("Call ~s: ~w~n",
["what_am_i()", what_am_i()]),
"hi there" ++ "1 - 2" = "hi there" ++ "1 - 2",
"1 * 2 + 3" = "1 * 2 + 3",
1 + 2 + 3 = 1 + 2 + 3,
{val, _, integer, 456} = {val, 123, integer, 456},
{val, 123, integer, 456} = {val, 123, integer, 456},
{val, 123, integer, 456} = {val, 123, integer, 456},
1 + {val, 123, integer, 456} = 1 +
{val, 123, integer, 456},
FreeVar = 12,
13 + 12 = 13 + FreeVar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment