[erlang-questions] parameterized modules alternative in chicago boss like use case
Jachym Holecek
freza@REDACTED
Mon Jul 4 19:39:09 CEST 2011
# Pablo Platt 2011-07-04:
> The powerful part is being able to use the model in an erl_dtl template:
> {% for greeting in greetings %}
> <li>{{ greeting.text }}</li>
> {% endfor %}
[I'll probably be slightly offtopic, but this caught my attention.]
Hmm, looks like a particularly complicated way to say:
[{li, [], Greeting} || Greeting <- somehow_get_list_of_greetings()]
And you'd pass that to a function that expands [{Tag, Attrs, Body}] to
HTML (doing some quoting here and there). My point is: why do people keep
inventing obscure ad-hoc languages instead of just encoding stuff as
Erlang terms and having normal Erlang functions operate on them?
Your other concerns then become the usual question of structuring your code
properly, finding out appropriate representations of things, abstracting out
common constructs etc.
But then I must be missing something here; I always must be when it comes
to Awesome Modern Intarweb Techniques.
BR,
-- Jachym
More information about the erlang-questions
mailing list