mirror of
https://github.com/Baidicoot/rpncalc-v4
synced 2024-11-15 06:14:49 +00:00
34 lines
1.1 KiB
HTML
34 lines
1.1 KiB
HTML
<html>
|
|
<h1>RPNCalc V4 Public Testing</h1>
|
|
<p>@ me (aidanprattewart@protonmail.com) if you have any errors, with console output please.</p>
|
|
<p>
|
|
Example Programs:
|
|
<br>
|
|
<code>(swap; a b -> a b) 1 2 swap</code> N.B. args are in reverse order
|
|
<br>
|
|
<code>1 + 2 (v partial -> 'v partial)</code> Evaluate a partial
|
|
</p>
|
|
<input type="text" id="inbox">
|
|
<button id="submit">execute</button>
|
|
<p id="outbox"></p>
|
|
<script src="./main.js" type="module"></script>
|
|
<p>
|
|
<h2>Docs</h2>
|
|
<h3>Lambda/Function Syntax</h3>
|
|
named function (added to scope, not applied): <code>(swap; a b -> b a)</code>
|
|
<br>
|
|
can be called later like: <code>1 2 swap</code>
|
|
<br>
|
|
unnamed function, applied immediately: <code>1 2 3 (a b c -> a b c)</code>
|
|
<br>
|
|
when lambdas return, they return entire stacks, which are sequentially applied back onto the stack
|
|
<h3>Partial Application</h3>
|
|
<code>1 +</code> will push a partially-applied function onto the stack
|
|
<br>
|
|
this could be called with: <code>1 + (partial -> 2 partial)</code>
|
|
<h3>Pairs</h3>
|
|
pairs of 2 values can be created with <code>pair</code>
|
|
<br>
|
|
they can be deconstructed using <code>fst</code> or <code>snd</code>
|
|
</p>
|
|
</html> |