SLet

From Esolang
Jump to navigation Jump to search

<- Older version | Newest version

SLet
Designed by User:I am islptng
Appeared in 2025
Computational class Turing-complete
Reference implementation none
Influenced by Lua
File extension(s) .slet



SLet 1 has no clear type, SLet 2 has limited commands, so the author created SLet 3!

Data types

In this esolang, there is 5 data types.

Number: Fraction. Size is unlimited. Division by 0 is NaN.
Boolean: true or false.
Pair: A pair of objects. One former value and one latter value.
Lambda: Just a lambda function.
Set: The most common data type. Objects in a set is always sorted. Boolean < Number < Pair < Set < Lambda.

Commands

==== Flow Control
for          | For every object in set A, store it in variable named B, and execute lambda C.
while        | While boolean A is True, execute lambda B.
do           | Start define a lambda. End with "all".
call         | Executes lambda A.

==== Input/Output
get-char     | Get a character input.
put-char     | Print a character.
input        | Get a number input.
print        | Print an object.

==== Data structures and calculations
match        | Make a pair. Returns (A,B).
combine      | Makes a set with various objects by union. End with "all".
opposite     | Not boolean A. Negate number A.
swap         | Swap the two objects in pair A. Swap the numerator and the denominator in number A.
former       | Former object of pair A. Numerator of number A.
latter       | Latter object of pair A. Denominator of number B.
pack         | Pack object A into a set.
exist        | True if object A is a subset of object B.
reveal       | Pick a random object from set A. Randomly choose an integer between the 2 numbers in pair A.
add          | Does addition between numbers, OR between booleans.
multiply     | Does multiplication between numbers, AND between booleans, intersection between sets.
divide       | Does division between numbers.
range        | Python "range(A,B,C)". Returns sets.
filtrate     | For every object in set A, store it in variable named B, if C is false, throw away the item.
size         | The size of set A.

==== Variables
let          | Set the variable named A to B.
==== Constants
true, false, empty

==== Extensions
require      | Import a local library.
/ is used for sub-objects.

Strings can be written in double quotes. Use backslash for escape. Comments are written between parentheses.

Examples

Hello world

for "Hello, world!" i do put-char latter i all

A+B problem

print add input input