iterate records

48 views
Skip to first unread message

pablo

unread,
Jul 4, 2011, 7:50:22 AM7/4/11
to ErlyDTL Users
Hi

I want to iterate over a list of records with a for loop.
A nice feature could be to use exprecs to create a callback module for
a record.
https://github.com/esl/parse_trans/blob/master/doc/exprecs.md
erlydtl will get the record name from the first element of the tuple
and use a module with the same name to get attributes.
myrecord:'#get-'(Attr, Rec)

Another interesting feature is to define a field value that will allow
to dynamically load children of a record.
For example, the following will load children of group_product with id
15:
{group_product, {"my-group-product", 15, 100, {#load, children, 15}}

Can I make the existing 'for' tag work with records or do I need to
create a custom tag?
Are there docs on how to write custom tags?

Thanks

Evan Miller

unread,
Jan 19, 2013, 7:52:54 PM1/19/13
to erlydt...@googlegroups.com
Eons later...

Records are not supported. I like your ideas here. For now you'll need to create a custom tag -- check out the README if you're still interested.
Reply all
Reply to author
Forward
0 new messages