Remove Line Numbers
Number every line, and the interpreter gives you the text back without the numbers.
None1, 2023 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
None1 made Remove Line Numbers, RLN for short, as a joke. A program is text in which every line starts with its own line number. Running it removes the numbers and prints what is left. So every text is a program once it is numbered, and the program prints exactly that text.
Read the story
The numbers must be right. Line 1 says 1, line 2 says 2, and so on. 0x0f, 4.5 and -1 are all errors, and so is a number in the wrong place.
The machine
The reference interpreter is 30 lines of C++. It reads a number with scanf, checks it against a counter, then prints the rest of the line with its leading spaces removed. The first wrong number prints Invalid syntax and stops.
Since scanf skips all whitespace before a number, empty lines between numbered lines do no harm. A line without a number does.
Example
The 99 bottles in the specification numbers every verse 1 and leaves the second line of each verse…
The 99 bottles in the specification numbers every verse 1 and leaves the second line of each verse without a number. The reference prints the first line and then Invalid syntax.
Ideas it shows
See also
Also in Jokes
Write your own in Run Convert a program from Remove Line Numbers
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: remove-line-numbers.
Command line
shib run remove-line-numbers -e '1 a'shib manual remove-line-numbersSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/remove-line-numbers.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org