Reverse Polish Ruby

Discussion in 'Ruby' started by jjthrash@gmail.com, Oct 20, 2006.

  1. Guest

    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

    Jimmy
     
    , Oct 20, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ron
    Replies:
    1
    Views:
    897
    Stewart Gordon
    Jul 2, 2003
  2. Replies:
    2
    Views:
    749
    Oliver Wong
    Feb 6, 2006
  3. dogbite
    Replies:
    4
    Views:
    694
    osmium
    Oct 10, 2003
  4. Steve Lambert

    Reverse polish

    Steve Lambert, Dec 19, 2004, in forum: C Programming
    Replies:
    11
    Views:
    639
    infobahn
    Dec 30, 2004
  5. Michel Martens
    Replies:
    5
    Views:
    128
Loading...

Share This Page