Here is what is wrong with Option.
option.ifPresent(x -> System.out.println(x));
So instead of just checking to see if it is NULL you want me to create an instance of a specialized class that holds my variable that has a method that acts like an "if" statement that I need to pass an anonymous function to that receives the value I already have?
Why not just do:
x && System.out.println(x)
or:
System.out.println(x) if x
Or if you want to skip over the rest of the logic if it is null:
return unless x
System.out.println(x)
I don't see why I need to introduce a new type system and complicate things.
For default values you want me to create an instance of specialized class that holds my variable and has a method that allows me to get my value or return a default value?
option.orElseGet(5)
So instead of a memory lookup I now need the overhead of an entire function call?
Why not just do:
x ||= 5
Or better yet, just put it in your function declaration as a default value:
myFunc = (x=5, y, z) -> ...
The one benefit I see is type safety but it is extremely rare for experienced programmers working in dynamic languages to have bugs related to type.
You are layering on abstractions and forcing programmers to go through hoops just to get at their data. It is more complicated and increasing the cognitive load.
There's also the fact that you are going through functions and classes instead of just memory accesses. This makes code less performant as well.