rLS

From Esolang
Jump to navigation Jump to search

rLS (revised/reduced Lambdastack) is a stack programming language based on Lambdastack. It removes most of the ugliness and several features from the old one, but also adds support for new ones.

Commands

[vars:code] Push a limiting lambda with variables in vars as input
[code] Push a limiting lambda with no input
{vars:code} Push a non-limiting lambda with variables in vars as input
{code} Push a non-limiting lambda with no input
' Run the lambda on top of stack
" Convert lambda with input to one without input by popping the needed arguments from stack and applying them, without running the lambda
variable Push the contents of a variable

Variables

Variables are either one character long, in which case they can be written as is (e.g. x), or longer, in which case they need to be enclosed in parentheses (e.g. (foo)). Variables are visible only inside the lambda they were bound from, and this does not include other lambdas lexically inside it.

Limiting / Non-limiting Lambdas

Limiting lambdas function like lambdas in original Lambdastack, in that they prevent any stack access into the stack outside what was pushed by the lambda itself. Non-limiting lambdas on the other hand allow this. They are effectively equivalent to Lambdastack's [%vars:code], except when converted into inputless they don't take the whole stack with them.

Computational class

All Underload commands except for S can easily be transformed into rLS. Therefore, rLS is Turing-complete.

Underload rLS
~ [xy:yx]'
: [x:xx]'
! [x:]'
* {xy:x'y'}"
(code) {code}
a [x:x]"
^ '