tcalc : A small ruby-based RPN-calculator
| script karma
Downloaded by 2627
Comments, bugs, improvements
script versions (upload new version)
Click on the package to download.
ip used for rating: 126.96.36.199
||- help command (not really useful yet)
- help (not really useful yet)
- ruby 1.8 compatibility
- FIX: help command
- Interpret .[0-9]+ as float (suggested by John Orr)
MD5 checksum: b2f2bf21e1fe9cb0bdc612a7cb973621
||- New words: all?, any?, array_*, and, or, !=
- Curses frontend: Show possible completions; map 127 to backspace, F1
to 'ls'; improved handling of cursor keys etc.
- Debugger (sort of)
- FIX: Nested blocks & more
||- rm,* ... Remove all words
- If g:tcalc_lines < 0, use fixed window height.
- VIM: use the tcalc window to display plots, lists etc.
- FIX: Nested words and some more
||- FIX: Curses frontend: Display error messages properly
- FIX: readline support.
- FIX: sort words on completion
- Distribute as zip
||- Named arguments: args is a synonym for assert but provides for named
- New words: Sequence/seq, map, mmap, plot (a simple ASCII function
plotter), stack_size, stack_empty?, iqueue_size, iqueue_empty?
- Syntactic sugar for assignments: VALUE -> VAR
- Defined "Array" as a synonym for "group"
- "define" command as alternative to the forth-like syntax for defining
- Dynamic binding of words/variables (the words "begin ... end"
establish a new scope)
- The stack, the input queue, and the dictionary are accessible like
words (__STACK__, __IQUEUE__, __WORDS__)
- TCalc and tcalc#Calculator take initial tokens as argument.
- TCalc! with [!] will reset the stack & input queue.
- Completion of partial commands
- Readline-support for CLI mode (--no-curses).
- Simple key handling for the curses-based frontend
- Non-VIM-versons save the history in ~/.tcalc/history.txt
- #VAR,METHOD has slightly changed.
- TCalc syntax file.
- FIX: Command line completion
||- Comments: /* ... */
- New words:
- assert: Display an error message if the stack doesn't match the
- validate: Like assert but push a boolean (the result of the check)
on the stack.
- do: synonym for recapture.
- source: load a file (see also g:tcalc_dir)
- require: load a ruby library
- p: print an object (doesn't do much, but prettyprint seems
to have problems)
- history (useful when using tcalc as stand-alone calculator)
- tcalc.rb can now be used as stand-alone program (a simple
||- Included support for rational and complex numbers
- Included matrix support
- Syntax for pushing arrays [ a b c ... ]
- New "at" method to select an item from array-like objects
- Removed shortcut variables.
||- Minor fix: command regexp
||- COUNT can be "#", in which case the top number on the stack will be
used (e.g. "3 dup3" is the same as "3 3 dup#")
- Disabled vars, (, ) commands
- Variables are words
- New words can be defined in a forth-like manner ":NAME ... ;"
- Built-in commands get evaluated before any methods.
- Messages can be sent to objects on the stack by "#N,METHOD", e.g. "1 2
g2 3 #1,<<" yields "[1,2,3]"
- The copyN, cN command now means: push a copy of element N.
- ( ... ) push unprocessed tokens as array
- recapture command (feed an array of unprocessed tokens to the input
- if, ifelse commands
- delN, deleteN commands
- Can push strings ("foo bar")
- "Symbols" à la 'foo (actually a string)
||- The swap count argument is increased by one (for conformance with the
- Shortcuts are now RPN expression (elements at the stack can be
referred to by # (= top element) or #N).
- Removed g:tcalc_reverse_display
- Positions on the stack can be referred to by #N.
- rot works the other way round
- d, dup command
- clear command
- print, hex, HEX, oct, dec, bin, float, format commands
- Removed dependency on tlib
- Variables; ls, vars, let, =, rm commands
- Command line completion for variables and commands
||- Arguments were (not properly) reverted: 12 4 / now yields 3.
- The input will be split into tokens, i.e. you can input "1 2 + <cr>"
or "1<cr>2<cr>+<cr>". (Command-line completions doesn't work properly
- The syntax has slightly changed: "CmdCount,Arg", eg, "y3,a"