Skip to content
A small ruby-based RPN-calculator with optional VIM integration
Ruby VimL
Find file
New pull request
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


It turns out that ruby is pretty good at maths and deals well with 
complex or rational numbers etc. Anyway, in certain occasions a postfix 
syntax and a stack are better suited for calculations than ruby's infix 
syntax. So, here comes ...

    A small ruby-based[*] RPN-calculator, a simple ASCII function 
    plotter, and stack-based playground :-).

The tcalc.rb script can also be used as a stand-alone calculator (with 
optional support for curses and readline). Run "tcalc --help" for 
information on the command-line options.

    - Numbers (anything that starts with "-" or a decimal)
    - Strings (anything that matches /^"(.*?)"$/)
        - Be aware that the strings and numbers get evaluated by ruby. 
          You can thus execute ruby code by input like: -1;p'foo'
    - Methods & constants of the following classes are available:
        Float    ::
        Complex  ::
        Rational ::
        Integer  ::
        Matrix   ::
        Vector   ::
        Math     ::
    - #N (pull the item at position N to the top)
    - Call words: WORD[COUNT][@ARRITY][,ARGUMENT]
        - If COUNT is "#", the top element will be used.
    - Enter, escape => exit

Tokens are separated by blanks (à la forth). The blanks between the 
words thus are significant.

[*] For use with VIM, built-in ruby support (:echo has('ruby')) is 


Status:  Works for me (there may be some minor quirks)
Install: See
See for related plugins.

Something went wrong with that request. Please try again.