
JEP draft: Type operator expressions in the JVM - ScottWRobinson
http://openjdk.java.net/jeps/8204937
======
kodablah
> The syntax will allow any single type descriptor to be modified by an
> optional suffix, which has the effect of constraining the original type
> descriptor in an ad hoc, programmable manner

So, if I had a JVM dependent type lib, could my type be
"Ljava/math/BigInteger;/$contract[$nonNegative;]"? Are we sure we want this
buried in the name?

EDIT: There's a similar example "I/$interval[$ge;0;]" which seems to imply
some might want to burying a mini expression language in there. I can think of
a lot of uses and a lot of abuses. But at the very least, it allows you to
give arguments to types that persist in the bytecode.

~~~
kjeetgill
JDK11 introduces CONSTANT_dynamic[0] so anything expressed by that type
descriptor string should also be expressible as a call to a bootstrap method
at link time.

I think. Never played with it myself but here is a "bestiary"[1] of
possibilities that CONSTANT_dynamic already opens up.

[0]: [http://openjdk.java.net/jeps/309](http://openjdk.java.net/jeps/309) [1]:
[https://github.com/forax/exotic](https://github.com/forax/exotic)

~~~
kodablah
Sure, or really just bury the method call/descriptor as an arg. It's not that
much different than annotations.

