Last active
December 12, 2015 07:08
-
-
Save beho/4734005 to your computer and use it in GitHub Desktop.
Record attribute default value by function call
This file contains hidden or 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
# compilation fails (function blank/0 undefined) | |
defmodule RDF do | |
defmodule Util do | |
def blank do | |
"_:1" | |
end | |
end | |
def blank do | |
"_:1" | |
end | |
defrecord Triple, subject: blank #, predicate: blank, object: blank | |
end | |
# all good | |
defmodule RDF do | |
defmodule Util do | |
def blank do | |
"_:1" | |
end | |
end | |
def blank do | |
"_:1" | |
end | |
defrecord Triple, subject: Util.blank #, predicate: blank, object: blank | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment