Created
January 18, 2015 22:26
-
-
Save thislooksfun/cace22f870bb431afa35 to your computer and use it in GitHub Desktop.
Ideas for programming language built on top of Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//If statement | |
//Java: | |
if (foo != null && foo != bar) {} | |
//TLF: | |
if (foo != null &!= bar) {} | |
&= bar <is equal to> && foo == bar | |
&! bar <is equal to> && foo != bar | |
&.* bar <is equal to> && foo.*(bar) | |
//null checks | |
If an object is not a boolean, then this: | |
if (o) {} | |
will be equal to: | |
if (o != null) {} | |
//Teriary operators: | |
int i = (true ? 1 : 2); //VALID | |
spawntype == 2 ? spawnFish() : spawnBird(); //Also valid | |
Options.autosave ? save(); //Still valid | |
//String manipulation: | |
"Hello"*2 //Returns "HelloHello" | |
//Loops | |
for (int i : 10) //Same as 'for (int i = 0; i < 10; i++)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment