[erlang-questions] Funargs: Ruby-like blocks for Erlang

Joe Williams joe@REDACTED
Tue Sep 13 23:32:37 CEST 2011


> Xml:posts do
>  lists:each(Posts) do |Post|
>  Xml:post do
>  Xml:title(Post#post.title),
>  Xml:body(Post#post.body),
>  Xml:published_at(Post#post.published_at),
>  Xml:comments do
>  lists:each(Post#post.comments) do |Comment|
>  Xml.comment do
>  Xml:body(Comment#comment.body)
>  end
>  end
>  end
>  end
>  end
>  end

Just happened across this thread, late to the party. Perhaps you could write your patch to do "ennnnnnd" rather than six "ends".

-Joe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110913/4b3664a0/attachment.htm>


More information about the erlang-questions mailing list