mirror of
https://github.com/osmarks/website
synced 2025-08-31 01:37:57 +00:00
RPNCalc overhaul
This commit is contained in:
@@ -12,8 +12,13 @@ code {
|
||||
background-color:rgb(230, 230, 230);
|
||||
padding: 0 0.125rem;
|
||||
}
|
||||
|
||||
button {
|
||||
border: 1px solid gray;
|
||||
padding: 0.3em;
|
||||
}
|
||||
</style>
|
||||
<textarea id="inbox"></textarea>
|
||||
<textarea id="inbox" rows=10></textarea>
|
||||
<button id="step">step</button>
|
||||
<button id="play">play</button>
|
||||
<button id="load">load</button>
|
||||
@@ -26,7 +31,7 @@ code {
|
||||
<p>use <code>(name; value)</code> to define something. the definition can be recursive. <code>value</code> is executed and <code>name</code> is set to the final state of the stack, i.e. <code>(name; 1 3)</code> is possible</p>
|
||||
<p>use <code>'</code> to push instead of apply to the stack, e.g. <code>'(a -> a)</code>. This is useful for lazyness, i.e. <code>'(->lazy evaluated thing)</code></p>
|
||||
<ul>
|
||||
<li><code>+, -, *, /, ^, sqrt</code>: mathematical operations</li>
|
||||
<li><code>+, -, *, /, ^, sqrt, cbrt, exp, log, (a)cos/sin/tan, abs, floor</code>: mathematical operations</li>
|
||||
<li><code>==</code>: equality (automatically derived for all types); returns <code>a b -> a</code> if true, <code>a b -> b</code> if false</li>
|
||||
<li><code>typeof</code>: returns the type of the object</li>
|
||||
<li><code>pair, fst, snd</code>: pairs two objects, gets first or second item of pair</li>
|
||||
|
Reference in New Issue
Block a user