[erlang-questions] run-time record limitations

deepblue <>
Fri Jan 16 11:30:05 CET 2009


Im developing an Erlang system and having reoccurring problems with
the fact that record's are compile time pre-processor macros (almost),
and that they cant be manipulated at runtime... basically Im working
with a property pattern, where properties are added at run-time to
objects on the front-end (AS3). Ideally I would reflect this with a
list on the Erlang side, since its a fundamental datatype, but then
using records in QLC [to query ETS tables] would not be possible since
to use them I have to specifically say which record property I want to
query over... I have at least 15 columns in the larges table, so
listing them all in one huge switch statement (case X of) is just
plain ugly.

does anyone have any ideas how to elegantly solve this? maybe some
built-in functions for creating tuples with appropriate signatures for
use in pattern matching (for QLC)?

thanks



More information about the erlang-questions mailing list