 
     test "define a commented square function and use it" do
       assert RPNForthThing.initialize(~w[
-        # Compute the square of the top of the stack and leave it on the stack. ;
+        ( Compute the square of the top of the stack and leave it on the stack. )
         : square dup * ;
         10 square
       ]) == 100
     end
 
+    test "Forth example straight out of A Brief Introduction To Forth" do
+      # http://users.ece.cmu.edu/~koopman/forth/hopl.html
+      assert RPNForthThing.initialize(~w[
+        : SQUARED        ( n -- nsquared ) dup * ;
+        : SUM-OF-SQUARES ( a b -- c      ) SQUARED swap SQUARED + ;
+        3 4 SUM-OF-SQUARES
+      ]) == 25
+    end
+
     test "defining and using factorial" do
       # crap, I need a rot3 or something. brb... Done.
       assert RPNForthThing.initialize(~w[
-        : super_inner_factorial dup rot3^ * swap -- inner_factorial ;
-        # Checks if we've decremented below 1; if not, call innermost function ;
-        : inner_factorial dup 1 > if super_inner_factorial drop ;
-        # Entry point. Pushes a running total onto the stack and swaps ;
+        ( Checks if we've decremented below 1; if not, recurse )
+        : inner_factorial dup 1 > if dup rot3^ * swap 1- inner_factorial else drop then ;
+        ( Entry point. Pushes a running total onto the stack and swaps )
         : factorial 1 swap inner_factorial ;
         6 factorial
       ]) == 720

  end

  # In-place decrement
  def compute([ "--" | remaining_input], [x | stack], dict) do
    compute(remaining_input, [(x - 1) | stack], dict)
  end

  # In-place increment
  def compute([ "++" | remaining_input], [x | stack], dict) do
    compute(remaining_input, [(x + 1) | stack], dict)
  end


  end

  # Comments
  def compute([ "(" | remaining_input ], stack, dict) do
    {_, [")" | remainder]} = Enum.split_while(remaining_input, fn(ins) -> ins != ")" end)
    compute(remainder, stack, dict)
  end

