Trivial SAM convertion

Boaz Nahum boaznahum at gmail.com
Tue Apr 2 06:06:30 PDT 2013


During my attempts to *lambdafying* my code, I came to places like this:


*Predicate<File> isDir = File::isDirectory;*
**
*
*
*Predicate<File> isFile = isDir.negate();*
**
*
          FileFilter isFileFilter = isFile::test;

*
*At first, naively I just wrote:
*
*FileFilter isFileFilter = isFile;

*
*After realizing my mistake, I wondered 'Why not *?' If we have two SAM
interfaces with identical signatures (test & accept) then one can be
converted to other.

I understand I will it is too far change JLS. But I'm asking if it is ever
considered ?

If I may, one more question. Is this will be ever a valid code ?:

Predicate<File> isFile = (File::isDirectory).negate();
**

Thanks
Boaz

**


More information about the lambda-dev mailing list