Abstract patterns
ke han
ke.han@REDACTED
Wed Mar 15 06:53:37 CET 2006
Richard,
I've just read your paper on abstract patterns (found it in-lined in
a mailist post from a year or two ago).
After a day or so of letting it sink in, I am coming around to your
point of view on its usefulness in encapsulating term structure.
The problems with records is obvious but the record update and
matching syntax is much more readable than the update function of
your abstract patterns (see your quote below).
<quote>
L2 = L#log{blocked_by = none, status = ok}
which is arguably prettier than
L2 = L#log_blocked_by(none)#log_status(ok)
</quote>
<quote>
#log{status == S, users = N} = L
which is arguably prettier than
#log_status(S) = #log_users(N) = L
</quote>
So the question I have is, is this syntax as good as it gets? Is
there any way to improve on this syntax? particularly the update and
matching.
thanks, ke han
More information about the erlang-questions
mailing list