The fewer spaces between an operator and its arguments, the earlier the execution?" I don't know the answer to this, but it did lead me to come up with the following joke language inspired by ill-conceived supposedly "helpful" language features:
- To eliminate hard-to-read brackets, code is evaluated depending on spacing. That is,
3-2 - 1is
3 - 2-1is
- The multiplication operator is
xinstead of the confusing
*. Yes, the spaces are part of the operator and don't count towards the evaluation order.
- Of course, the evaluation order of ambiguously spaced code is undefined.
3 x 2 + 1may be
7in a valid implementation.
- Division is done using nice, readable horizontal divisor lines:
3 --- x
- To eliminate confusing semicolons, periods are instead used to terminate function invocations and blocks:
- To allow flexibility, adding an extra space before a function parameter passes it in by name, which means it's evaluated each time it's used:
myfun 1, foobar 3..will evaluate
foobar 3.as many times as it's used, whereas
myfun 1,foobar 3..evaluates it exactly once.
- Our language also supports coroutines! Simply wrap any code in the "aside operator", also known as "brackets":
- As a convenient shorthand, any function call terminated with a
!instead of a
.will exit the program with a code of 1 if the function call returns a falsey value.
- The boolean values are
no, though they're actually just alternate names for
1. (0 is true to maintain compatibility with unix exit codes.)
- Everything but
yesis falsey, for simplicity's sake.
- Variables are declared using the syntax
x is 3.and changed using
x becomes 3..
- To prevent arguments over naming, the following variable names are considered the same:
foobaris a different variable.
- There is also an
aliascommand to define aliases of variable names at runtime. The effect of this command is global. It's an excellent tool for multilingual teams.
- Comments, since they're important, are enclosed between triple explanation marks.
Finally, here's an example function in this language. Suggestions for "improvements" are very welcome. :D
function isPrime,x, div is 2. result is no. alias r to result. 2 while div < x, | x | remainder is x - |---|. !!!Using easy visual representation of the floor function.!!! _div_ remainder is 0? r becomes yes. . .