Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# why a macro...
defmacrop d(sign, coef, exp) do
quote do
%Decimal{sign: unquote(sign), coef: unquote(coef), exp: unquote(exp)}
end
end
# instead of a function?
def d(sign, coef, exp) do
%Decimal{sign: sign, coef: coef, exp: exp}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.