RPNCalc V4 Public Testing

@ me (aidanprattewart@protonmail.com) if you have any errors, with console output please.



Docs

Lambda Syntax

lambda: a b -> b a parensed lambda: (a -> a)

Let-In Syntax

not called immediately; call-by-name
let: (name; value1 value2) N.B. when called, applies (pushes) both values to the stack
example named function: (++; x -> x 1 +)

Pairings

1 2 pair evaluates to {1, 2}
can call fst and snd on pairs

Partials

'+ pushes (not applies) a closure onto the stack
1 + is a partially applied function/closure

Type Literals

Essentialy strings.
Example useage: "1 "int unsafeCoerce 1 +

Equality

Internaly JS-based, derived for all objects, pushes lambdas representing true and false onto the stack.
For example: "true-option "false-option val1 val2 ==

Examples

factorial: (!; x -> 1 '(-> x 1 - ! x *) x 0 ==)
fold (stops at type literal "stop): (fold; x acc fn -> '(-> acc) '(-> x acc fn 'fn fold) 'x \"stop ==)