Tab

From Esolang
Jump to navigation Jump to search

Tab is an esoteric programming language inspired by tabs in a web browser after discovering that closing a previously clicked page leads to a special mechanism in User:A's web browser.

Syntax

Input/Output is for debugging.

₦x: Click(i.e. navigate to) page x. This will link to the previous page clicked. Navigation to a blank page is an error and this makes Tab halt immediately.
†x: Create a new page named x. It will automatically be clicked as it ends the previous page click linking. If there is such a page, do nothing and ignore input commands.
ɖ: Close the current page. It will navigate to a previously linked page.
←: Navigate to the previous page link (if there is a previous page link)
→: Navigate to the next page link (if there is a next page link)
¢x: Navigate to page x if the current page's name is zero. Navigation to a blank page is an error and this makes Tab halt immediately.
ː: Debug. Output the current page.
…: Debug. Change the current page as one line of input and halts when input is EOF.

When all tabs are closed, the execution halts(as the browser closes by default). Otherwise, it continues as the program counter goes page to the beginning.

Example(s)

Output 1

†2†1₦2ɖː

This outputs 1 and only 1 because 1 will be navigated to after 2 is closed.

Infinite loop


Cat program

†1…ː

Truth-machine

†1…ː¢8ː