Created
October 26, 2018 16:49
-
-
Save shdblowers/fea07b9f76aab618ef59c5ec3cc55efd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule FilePrinter do | |
@callback parse(String.t) :: {:ok, term} | {:error, String.t} | |
@callback extensions() :: [String.t] | |
defmacro __using__(_opts) do | |
quote do | |
def output(parsed_str) do | |
IO.puts(parsed_str) | |
end | |
def print(str), do: str |> parse() |> output() | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment