Skip to content

Instantly share code, notes, and snippets.

View DerKastellan's full-sized avatar

DerKastellan DerKastellan

View GitHub Profile
@nwalker
nwalker / constants.ex
Last active May 18, 2019 01:37 — forked from smpallen99/constants.ex
Approach for constants shared between modules in Elixir
defmodule Constants do
defmodule Extractor do
require Record
Record.defrecord :tree, [:type, :pos, data: :undefined]
Record.defrecord :attr, :attribute, [:name, :args]
def extract(opts) do
cond do
lib = opts[:from_lib] -> from_lib_file(lib)
file = opts[:from_file] -> from_file(file)