# Reverse Polish Ruby

**URL:** <https://www.ruby-forum.com/t/reverse-polish-ruby/73007>\
**Category:** Ruby\
**Created:** [October 20, 2006, 4:12pm UTC](https://www.ruby-forum.com/t/reverse-polish-ruby/73007 "2006-10-20T16:12:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 20, 2006, 4:12pm UTC](https://www.ruby-forum.com/t/reverse-polish-ruby/73007/1 "2006-10-20T16:12:32Z")

</div>

Hey folks,

So… all I wanted was an RPN calculator. So I wrote one. But, I  
thought, why should I reimplement +? Or -, sin, etc? So I decided to  
pass those requests along to Ruby. After that, my coworker joined in  
and we went a little overboard.

The resulting monstrosity is a gruesome combination of object oriented  
programming language and Reverse Polish Notation. For example: “2 1 +”  
yields 3, right? It’s really doing 2.send(:+, 1).

Feel free to try it out. I kinda like it. But don’t say I didn’t warn  
you it was gruesome. At least it’s a usable RPN calculator, and it’s  
fun that “1 1 { dup2 + } 10 evaln” gives you the first 12 numbers of  
the Fibonacci sequence.

gem install rprb --source [http://gems.jimmythrasher.com](http://gems.jimmythrasher.com)

Jimmy
