<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,7 +1,7 @@
 CC=gcc
 CFLAGS=-g -Wall
 
-OBJECTS=rpn.o stack.o lex.o functions.o
+OBJECTS=rpn.o stack.o lex.o 
 
 all: $(OBJECTS)
 	$(CC) -o rpn $(OBJECTS)</diff>
      <filename>Makefile</filename>
    </modified>
    <modified>
      <diff>@@ -14,9 +14,9 @@ Usage
 
 *   __addition__
 
-        10 2 1 + .
+        10 2 + .
 
-    Prints 13, the sum of 10, 2, and 1.
+    Prints 12, the sum of 10 and 2.
 
 *   __subtraction__
 
@@ -38,6 +38,11 @@ Usage
 
 Note that you can 'peek' the top of the stack anywhere in an expression, ie:
 
-    10 2 + . 2 / .
+    1 2 + . 4 * . 5 + . 3 - .
 
-    Prints &quot;12&quot; and then &quot;6&quot;
+Prints:
+
+    3
+    12
+    17
+    14</diff>
      <filename>README.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,6 @@
 #include &lt;stdlib.h&gt;
 #include &quot;lex.h&quot;
 #include &quot;stack.h&quot;
-#include &quot;functions.h&quot;
 
 int main(int argc, char *argv[]) {
 
@@ -12,16 +11,21 @@ int main(int argc, char *argv[]) {
     if(t.type == T_VALUE) {
       stack_push(&amp;s, t.value);
     } else {
+      float arg1,arg2;
       switch(t.symbol[0]) {
-        case '+': f_add(&amp;s);
+        case '+': stack_push(&amp;s, stack_pop(&amp;s)+stack_pop(&amp;s));
                   break;
-        case '-': f_subtract(&amp;s);
+        case '-': arg1 = stack_pop(&amp;s);
+                  arg2 = stack_pop(&amp;s);
+                  stack_push(&amp;s, arg2-arg1);
                   break;
-        case '*': f_multiply(&amp;s);
+        case '*': stack_push(&amp;s, stack_pop(&amp;s)*stack_pop(&amp;s));
                   break;
-        case '/': f_divide(&amp;s);
+        case '/': arg1 = stack_pop(&amp;s); 
+                  arg2 = stack_pop(&amp;s);
+                  stack_push(&amp;s, arg2/arg1);
                   break;
-        case '.': f_print(&amp;s);
+        case '.': printf(&quot;%g\n&quot;, stack_peek(&amp;s));
                   break;
         case 'q': free_stack(&amp;s);
                   printf(&quot;Exiting\n&quot;);</diff>
      <filename>rpn.c</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>functions.c</filename>
    </removed>
    <removed>
      <filename>functions.h</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>32190002a82181cef658b1f992bc4349a0a64ea4</id>
    </parent>
  </parents>
  <author>
    <name>Alan Dipert</name>
    <email>alan.dipert@gmail.com</email>
  </author>
  <url>http://github.com/alandipert/minirpn/commit/87eb2d25e2f5ab9f98f4a0f8f69cc9e480c16e38</url>
  <id>87eb2d25e2f5ab9f98f4a0f8f69cc9e480c16e38</id>
  <committed-date>2009-11-07T12:39:34-08:00</committed-date>
  <authored-date>2009-11-07T12:39:34-08:00</authored-date>
  <message>extensive simplification</message>
  <tree>9e0718fec39532b7f05b924434a99bfd64d58c3c</tree>
  <committer>
    <name>Alan Dipert</name>
    <email>alan.dipert@gmail.com</email>
  </committer>
</commit>
