Hi everyone,<br><br><div class="gmail_quote">On Thu, Mar 19, 2009 at 1:22 PM, mats cronqvist <span dir="ltr"><<a href="mailto:masse@kreditor.se">masse@kreditor.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">my_lc_tq(Line, E, [{generate,Lg,P,G}|Qs], Mc, St) -></div>
all(s(qs,st,{Qs,St}),<br>
[fun(X)->s(X,gs,qs1, splitwith(fun is_guard_test/1,f(X,qs)))end<br>
,fun(X)->s(X,name,st, new_fun_name("lc", f(X,St)))end<br>
,fun(X)->s(X,head,st, new_var(f(X,st)))end<br>
,fun(X)->s(X,tname,st, new_var_name(f(X,st)))end<br>
,fun(X)->s(X,la,lanno,tail,my_lanno(Line,f(X,tname),f(X,st)))end<br>
,fun(X)->s(X,arg,st, new_var(f(X,st)))end<br>
,fun(X)->s(X,nc,'',st, my_expr(Lg,f(X,name),f(X,tname),f(X,st)))end<br>
,fun(X)->s(X,guardc,st, lc_guard_tests(f(X,gs),f(X,st)))end<br>
,fun(X)->s(X,lc,lps,st, lc_tq(Line,E,f(X,qs),f(X,nc),f(X,st)))end<br>
,fun(X)->s(X,pc,st, list_gen_pattern(P,Line,f(X,st)))end<br>
,fun(X)->s(X,gc,gps,st, safe(G,f(X,st)))end<br>
,fun(X)->s(X,fc,function_clause([f(X,arg)],f(X,la),{f(X,name),1}))end]).</blockquote><div><br></div><div>[...]</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
-define(S(X,Ts,Xp), fun(X)->s(X,Ts,Xp)end).<br>
<br>
my_lc_tq(Line, E, [{generate,Lg,P,G}|Qs], Mc, St) -><br>
all(s(qs,st,{Qs,St}),<br>
[?S(X,{gs,qs1}, splitwith(fun is_guard_test/1,f(X,qs)))<br>
,?S(X,{name,st}, new_fun_name("lc", f(X,St)))<br>
,?S(X,{head,st}, new_var(f(X,st)))<br>
,?S(X,{tname,st}, new_var_name(f(X,st)))<br>
,?S(X,{la,lan,tail},my_lanno(Line,f(X,tname),f(X,st)))<br>
,?S(X,{arg,st}, new_var(f(X,st)))<br>
,?S(X,{nc,'',st}, my_expr(Lg,f(X,name),f(X,tname),f(X,st)))<br>
,?S(X,{guardc,st}, lc_guard_tests(f(X,gs),f(X,st)))<br>
,?S(X,{lc,lps,st}, lc_tq(Line,E,f(X,qs),f(X,nc),f(X,st)))<br>
,?S(X,{pc,st}, list_gen_pattern(P,Line,f(X,st)))<br>
,?S(X,{gc,gps,st}, safe(G,f(X,st)))<br>
,?S(X,{fc}, function_clause([f(X,arg)],f(X,la),{f(X,name),1}))]).</blockquote><div><br></div><div><br></div><div>I find interesting (or curious) how people want to reach aesthetically pleasant code to read. No offense, really, it's just that I don't think it leads anywhere useful.</div>
<div>We saw from Richard O'Keefe at the beginning of the discussion that assignments were not that common in Erlang, and that destructive ones were even less common. In my opinion, while this is interesting in a "code beauty" aspect, it serves no useful purpose to overload the code with macros, helper functions, and other language candies that just try to solve a specific problem.</div>
<div><br></div><div>Just my two cents …</div><div><br></div><div>Best,</div><div>Cam</div><div><br></div></div>