Skip to main content

A tiny interpreter REPL with get/how/clear accumulator commands.

Project description

meak-interpreter

A tiny interpreter REPL with exact rational arithmetic and get/how/clear accumulator commands.

Features

  • Exact rational arithmetic using Python's Fraction
  • Operators: +, -, *, /, ^ (exponentiation)
  • Special operators: for (addition/concatenation), o (variable access)
  • Unary ? operator for value inspection
  • Accumulator commands: get, how, clear
  • Built-in functions: abs, pow, gcd, lcm

Installation

pip install -e .

Usage

Run the REPL:

meak

Or use as a Python module:

from meak_interpreter import MeakInterpreter

interp = MeakInterpreter()
interp.repl()

Examples

meak> 1/3 + 1/6
1/2
meak> x = 10
meak> y = 20
meak> x + y
30
meak> get 100
meak> get 50
meak> how
150
meak> clear

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meak_interpreter-0.1.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

meak_interpreter-0.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file meak_interpreter-0.1.0.tar.gz.

File metadata

  • Download URL: meak_interpreter-0.1.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.10

File hashes

Hashes for meak_interpreter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 93b966db3314794ade7dea70c59b0de15957575af7f7720ee8632ec6f4bd0e54
MD5 0184b8fa6dda0ad4840060a7ccfc6e44
BLAKE2b-256 4b5dfca5cf2581438af021c6ac95c633d11292e0fb606bd4980c7b4eb849ca43

See more details on using hashes here.

File details

Details for the file meak_interpreter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for meak_interpreter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b0490ad0c5cc01b4bca025c309188816efde6bf36d38d154494aed404650545
MD5 d70bb1d1efa93dd7fe42b2ebc605da96
BLAKE2b-256 8ef6efc1f88218366d14e90b8160193bcff97119b7b5485924bbfe512bc3dcbb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page