smack

command module
v0.0.0-...-e125446 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 6 Imported by: 0

README

smack

A simple RPN language

Install

$ go install github.com/j0hax/smack

Usage

Example: the input is the equivalent of (1 + 2) * 6, resultung in 18.

1 2 + 6 *
18

The smack interpreter works with standard input and output streams, meaining you can perform computations with pipes:

$ echo '1 2 + 6 *' | smack > out.txt
$ smack < out.txt
18

Standard Library

Very much a WIP. Some tokens for mathematical functions have been implemented, such as log. Check the source for the lexer.

Error Handling

Does not exist (yet). Don't try to pop more than the stack can handle, or else you won't be doing many calculations today.

Name Origin

I just wanted something that rhymes with stack.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL