Skip to content

Instantly share code, notes, and snippets.

@thislooksfun
Created January 18, 2015 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thislooksfun/cace22f870bb431afa35 to your computer and use it in GitHub Desktop.
Save thislooksfun/cace22f870bb431afa35 to your computer and use it in GitHub Desktop.
Ideas for programming language built on top of Java
//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