--
You received this message because you are subscribed to the Google
Groups group for http://projectlombok.org/
To post to this group, send email to project...@googlegroups.com
To unsubscribe from this group, send email to
project-lombo...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/project-lombok?hl=en
To me it makes sense. As you said, val is a one-of-its-kind feature and
with the import trick it would sound a bit more coherent with the
general approach of lombok...
--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
java.net/blog/fabriziogiudici - www.tidalwave.it/people
Fabrizio...@tidalwave.it
--
Hamlet D'Arcy
haml...@gmail.com
> --
> You received this message because you are subscribed to the Google
> Groups group for http://projectlombok.org/
>
> To post to this group, send email to project...@googlegroups.com
> To unsubscribe from this group, send email to
> project-lombo...@googlegroups.com
/** javadoc */
<T> public T with(T) {
throw new RuntimeException("You should...");
}
could be a member of this (or another) class. Actually, the return type
is not T (since the "proxy" method have different return type), but it
comes closed to (and doesn't matter much).
> The disadvantage is that you have to add "import lombok.val;" to your
> source. A small price to pay, you probably import loads of things.
Nice for the people not knowing lombok. With more such features, I'd be
happy if I'd need to do a single thing to allow all of them. Something
like annotating the whole class with @Lombok(10) could do, and the
version number would even allow you to do some incompatible changes when
necessary.
I'd be even happier if I could declare it once on the line specifying
the java agent, since the readability for people not knowing lombok
doesn't concern me.
There's still the problem of forking Java, but probably there's only one
thing you could do about it: Make it so useful and so well-known
that it makes it's way to JDK.
However, I don't see the big difference between extending Java using
annotations or using context-sensitive keywords. Whatever you do, it
either doesn't compile or it doesn't run or it does the wrong thing.
About the same holds for using any library, except for the dependency on
lombok being only compile-time.
The only bad thing would be to provide a feature incompatible with a
better feature planned for Java, or doing something in a way precluding
or complicating further improvements. I don't think it could be the case
with "val".
package lombok;
/** javadoc descriving what this does goes here */
public final class val {}
+1
import lombok.val; is the best way to future-proof this IMHO;
then we'd be safe if oracle/jcp/java/whatever eventually wakes up and
adds a val keyword.
--
my 2c
<>< Marius ><>