summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-20 21:58:41 +0200
committerPaul Buetow <paul@buetow.org>2026-03-20 21:58:41 +0200
commit3fb1a395ce147d364c811842ca87935caf75517a (patch)
tree1c285a443a6df467d41adf33374b088b5827cd97 /README.md
parent60d98e6fb3405b0fd595915f828bce12d2fa88db (diff)
README.md: add REPL mode notes about independent command evaluation
Diffstat (limited to 'README.md')
-rw-r--r--README.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/README.md b/README.md
index cb7d9a5..15571d9 100644
--- a/README.md
+++ b/README.md
@@ -134,6 +134,22 @@ perc calc 1 2 3 show # Show stack without modifying
# → 1 2 3
```
+### REPL Mode Notes
+
+In REPL mode, each line is evaluated independently. To chain operations:
+- Use the `rpn` subcommand for multi-step expressions: `rpn 2 3 + 4 -`
+- Or use the `rpn` command to set variables: `rpn x 5 =` then `rpn x x +`
+- The `show` command can display the final stack state
+
+Example REPL session:
+```
+perc> rpn 2 3 4 + # Push 2, 3, 4; add last two
+2 7
+perc> rpn show # Show full stack (but we start fresh per command)
+```
+
+Note: Each REPL command is evaluated independently, so you cannot chain operations like `2 3 4 +` then `-` on separate lines. Use `rpn 2 3 4 + -` for a single expression instead.
+
## Building
Using mage: