Nil allows you to check if an object is null in an if statement. Instead of writing:
if (object != null) { ... }
you would write:
if (object) { ... }
Experiment & Proof-of-Concept. While functional on Java 21, Nil is not recommended for any use. If you're looking for an alternative syntax, consider other JVM languages. It's not worth torturing the Java Compiler.
This project was inspired by Fluent, which provides a way to compile and test Nil.
- Fluent: static extension methods for Java.
- Lombok: the grand-daddy of
javac
hacks. - Manifold: a
javac
plugin with many features.
- Nil is not supported or endorsed by the OpenJDK team.
- The reasonable man adapts himself to the world. The unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. --George Bernard Shaw
This project is licensed under the MIT LICENSE.