<?xml version="1.0" encoding="windows-1252"?>
<node id="79658" title="Re: Golf: RPN calculator" created="2001-05-11 08:17:13" updated="2005-07-19 14:08:39">
<type id="11">
note</type>
<author id="45414">
jmcnamara</author>
<data>
<field name="doctext">
&lt;br&gt;
This was a great idea for a game of Golf. Recent outings have been too much like mini CS projects. Sorry [Masem]. ;-)
&lt;br&gt;
&lt;br&gt;
This uses your methodology. There are 69 chars in the body of the program. It passes &lt;tt&gt;-w&lt;/tt&gt; and &lt;tt&gt;strict&lt;/tt&gt;. It also handle negative numbers:
&lt;code&gt;
perl -le'/^\D$/?($_.=pop@_)&amp;&amp;push@_,eval pop(@_).$_:push@_,$_ for@ARGV;print@_'&lt;/code&gt;
&lt;br&gt;
I recently spent two months of my spare time implementing a type of RPN parser using Parse::RecDescent. Obviously I was taking the wrong approach. :-)
&lt;br&gt;
&lt;br&gt;
John.
&lt;br&gt;
-- 
&lt;br&gt;
&lt;br&gt;
</field>
<field name="root_node">
79436</field>
<field name="parent_node">
79436</field>
</data>
</node>
