Forgive my being naive.<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
Now let's do it with abstract patterns.<br>
<br>
#quit() -> quit;<br>
#quit() -> {?MODULE,{signal,{window1,_}}}<div id="1euh" class="ArwC7c ckChnd">;<br>
#quit() -> {?MODULE,{signal,{quit1,_}}}.<br>
<br>
#connect() -> {?MODULE,{signal,{connect,_}}}.<br>
<br>
#disconnect() -> {?MODULE,{signal,{disconnect,_}}}.<br>
<br>
#show_about() -> {?MODULE,{signal,{about1,_}}}.<br>
<br>
#hide_about() -> {?MODULE,{signal,{dialog1,_}}};<br>
#hide_about() -> {?MODULE,{signal,{dialogb,_}}}.<br>
<br>
#data(Data) -> {data,Data}.<br>
<br>
loop(State) -><br>
receive<br>
#quit() -> quit()<br>
; #connect() -> loop(conn(State))<br>
; #disconnect() -> loop(disc(State))<br>
; #show_about() -> loop(show_about(State))<br>
; #hide_about() -> loop(hide_about(State))<br>
; #data(Data) -> loop(update(State, Data))<br>
; X -> io:fwrite("got ~p~n", [X]),<br>
loop(State)<br>
end.<br></div></blockquote><br>So what's the advantage of that over something like this?<br><br>isa_quit(State) -><br> case State of<br> {?MODULE,{signal,{window1,_}}} -> true;<br> {?MODULE,{signal,{quit1,_} }} -> true;<br>
_ -> false<br> end.<br><br>isa_hide_about(State) -><br> case State of<br> {?MODULE,{signal,{dialog1,_}}} -> true;<br> {?MODULE,{signal,{dialogb,_}}} -> true;<br>
_ -> false<br> end.<br><br>isa_connect(State) -> case State of {?MODULE,{signal,{connect,_}}} -> true; _ -> false end.<br>isa_disconnect(State) -> case State of {?MODULE,{signal,{disconnect,_}}} -> true; _ -> false end.<br>
isa_show_about(State) -> case State of {?MODULE,{signal,{about1,_}}} -> true; _ -> false end.<br><br>wrap_data(Data) -> {data,Data}.<br><br>loop(State) -><br> receive RcvState -> if<br> isa_quit(RcvState) -> quit();<br>
isa_connect(RcvState) -> loop(conn(State));<br> isa_disconnect(RcvState) -> loop(disc(State));<br> isa_show_about(RcvState) -> loop(show_about(State));<br> isa_hide_about(RcvState) -> loop(hide_about(State));<br>
isa_data(RcvState) -> loop(update(State, RcvState));<br> X -> io:fwrite("got ~p~n", [X]), loop(State)<br> end end.<br><br>Everything's still named and abstracted, easier to maintain, update and repair, but this doesn't require new syntax or compiler alterations. So, what am I missing?<br>
<br> - John, who REALLY REALLY WANTS SELECTIVE EXPORT BADLY<br>