<div dir="ltr"><div class="gmail_quote">2008/7/3 Thomas Lindgren <<a href="mailto:thomasl_erlang@yahoo.com">thomasl_erlang@yahoo.com</a>>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="Ih2E3d"><br>
--- On Tue, 6/24/08, Tim Fletcher <<a href="mailto:twoggle@gmail.com">twoggle@gmail.com</a>> wrote:<br>
<br>
> I'm just checking to see if there might be some<br>
> recommended/documented<br>
> way of doing such a traversal. Trying to work it out from<br>
> parse<br>
> transform code directly is a bit intimidating (which is why<br>
> frabjous<br>
> is very appealing).<br>
<br>
</div>Personally, I've always tended to write my own, among other things because the appropriate traversal differs depending on what you want to do. But the erlang distribution itself includes a few hints:<br>
<br>
* erl_id_trans.erl contains a skeleton parse transform</blockquote><div><br></div><div>I agree. I have a modified version of erl_id_trans.erl which threads a (in this case dummy) state structure through all the calls as well as rebuilding the tree. It is a little easier to extend to be useful. It also uses some different styles when traversing the structure as examples of when you might need to handle them differently. For example passing over a list using mapfoldl (which fits this perfectly) when you know you can handle each element separately as opposed to processing the list explicitly when you need that.</div>
<div><br></div><div>It is not really documented but you cam "see" it when you know what to look for.</div><div><br></div><div>Robert</div><div><br></div></div></div>