Open sheharyarn opened 7 years ago
What's the error in the unquote(@attrs)
case? I honestly don't know how to make that work right now but my brain tells me "unquote fragments" and "using bind_quoted
somewhere in defdatabase
/deftable
" are part of the answer.
This is the error when I try with unquote(@attrs)
:
Compiling 1 file (.ex)
== Compilation error on file lib/mnesia.ex ==
** (ArgumentError) argument error
:erlang.length({:unquote, [line: 6], [{:@, [line: 6], [{:attrs, [line: 6], nil}]}]})
lib/amnesia/table/definition.ex:63: Amnesia.Table.Definition.define/4
expanding macro: Amnesia.Database.deftable/4
lib/db.ex:6: MyApp.DB (module)
Any updates?
@ourway I played around with it but didn't figure out a way to make it work :(
I'm trying to set the attributes of a table from a variable / module_attribute in the
deftable
macro, but it raises an exception instead.I also tried using
unquote(@attrs)
since it's a macro but that doesn't work either. Is there some way I can get this to work? (This is just an example, the attributes need to be loaded from another module during compile-time).This is the error I get: