<p>Typing this from phone, so forgive any terseness.</p>
<p>I have used his Erlang cut library, simplified code and made it more readable, but the limitations above are pretty nasty.  I recommend a style copying that of Boost.Phoenix, a C++ library designed for heavy functional usage, specifically it allows for what cut does, but also reordering of parameters and skipping parameters (as well as much more that goes well beyond the score of Erlang).  It does it like this (in an Erlangish way):</p>

<p>       fun(Arg1, _Arg2, Arg3) ->  Arg1:aCall(Arg3), Arg3 end</p>
<p>       (Arg1:aCall("test", Arg3), Arg3)</p>
<p>Probably use _ instead of Arg as the tag, or perhaps language support for something else that is not sorted by the current grammar.</p>
<p>Phoenix only goes up to Arg9 by default I think, but you can specify all others by templates:  arg_<12>()</p>
<p>I do not really care what the tag is, but if it is followed by its positional number, that fixes a lot.</p>
<p>P.S.  The reason that Pheonix starts at Arg1 instead of Arg0 is because Arg0 is a tuple of all the args as I recall, excellent for debugging.</p>
<p>P.P.S  Pheonix seems dynamically typed because it is.  It is a template tree that is evaluated, compiled, and even has optimization passes performed on it (in many cases outperforming hand written code to do the same thing, at worse matching it) by a template 'compiler', Boost.Proto, at the point that it is called.  Ingenious design.  Hefty compile time.  ;-)</p>

<div class="gmail_quote">On Jul 10, 2011 9:00 PM, "Richard O&apos;Keefe" <<a href="mailto:ok@cs.otago.ac.nz">ok@cs.otago.ac.nz</a>> wrote:<br type="attribution"></div>