rpncalc-v4/index.html

33 lines
1.0 KiB
HTML

<html>
<style>
* {
background-color: #101020;
color: ghostwhite;
}
</style>
<h1>RPNCalc V4 Public Testing</h1>
<p>@ me (aidanprattewart@protonmail.com) if you have any errors, with console output please.</p>
<textarea type="text" id="inbox"></textarea>
<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>