Callable

From Esolang
Jump to navigation Jump to search

Callable is an esolang by User:PythonshellDebugwindow.

Syntax

Each line is function calls in the form of F(), F(X), F(X, Y), and so on. Arguments can be function calls or strings.

BNF

<program> ::= <line> ( "\n" line )* | ""
<line>    ::= <id> "(" <f-inner> ")"
<f-inner> ::= <f-arg> ( ", " <f-arg> )* | ""
<f-arg>   ::= <line> | "\"" ( <ANY> - "\"" )* "\""
<id>      ::= ( <LETTER_UPPER> | <LETTER_LOWER> | "-" )+

Function list

Functions are given in the format FNAME(num-args).

IF-EQ(3+), IF-NEQ(3+), INPUT(0), PRINT(1), VAR-GET(1), VAR-SET(2), WHILE-EQ(3+), WHILE-NEQ(3+)

Examples

Hello, World!

PRINT("Hello, World!")

Cat

PRINT(INPUT())

Truth-machine

VAR-SET("n", INPUT())
WHILE-EQ(VAR-GET("n"), "1", PRINT("1"))
PRINT("0")

External resources