<p>Thank you for your comments.</p>

<blockquote>
<p>Reverse Polish notation is hideous.</p>
</blockquote>

<p>YMMV. :) As an HP (RPN) user and someone who has written a Forth interpreter in his formative years, I don't have issues moving between RPN and infix. I saw a RPN evaluator, I needed to add a function to it, it was faster to write a parser for RPN than try to extend and fix the existing parser (accounting for arity, LR(1) parsing, etc.). I understand not everyone will find <code>math_rpn</code> attractive or useful.</p>

<p>On a practical (rather than aesthetic) point, the extensions to the evaluator still make sense (but they are missing parsing in <code>math_eval</code>), and <code>math_rpn</code> is a good way to write unit tests (from an OpenSIPS script) for the individual functions and the evaluator itself.</p>

<blockquote>
<p><code>math_rpn("2 1 1 +*", "$var(res)")</code></p>
</blockquote>

<p>I made the choice (same as in Forth) of using blank-separated words. So you'd effectively have to write this <code>math_rpn("2 1 1 + *", "$var(res)")</code>.</p>

<p>I'll revise for code formatting.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href='https://github.com/OpenSIPS/opensips/pull/144#issuecomment-29553364'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/cHRwG-eeZpfKR_UBFXzvRCSdB-4bzhGpw_FHpTRchb-O-OPsLgjp-LRF_24hHyRs.gif' height='1' width='1'></p>