Skip to content

Instantly share code, notes, and snippets.

@fgallaire
fgallaire / main.erl
Last active April 29, 2019 14:30 — forked from hamidreza-s/main.erl
How to use Parse Transform feature in Erlang for meta-programming.
-module(main).
-export([hi/0, bye/0, hey/1]).
-compile({parse_transform, main_pt}).
hi() -> io:format("Hi there!~n").
bye() -> io:format("Bye there!~n").
hey(foo) -> io:format("Hey foo!~n");
hey(bar) -> io:format("Hey bar!~n").