Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COThank you for reply. I would really like to prevent explicit `try/catch`ing in lambda expressions because `try/catch` blocks look ugly making the lambdas ugly too. I guess there are at least two reasons of why it cannot work like that so far: 1) the history of Java itself; 2) a method, that's invoked with a lambda expression having methods with `throws` invocations inside, probably should be "automatically" declared as "`throws` _SomeEx_", even if the method is declared without any `throws` or it declares to throw exception of another type rather than could be propagated from the lambda.
      singulars
    2. CO3) If it could "swallow" checked exceptions, I think, then it might break your expectations for a checked exception or unchecked exception you might expect to catch in any caller outside. For example, you could expect to catch `IOException` for currently illegal code like `list.forEach(p -> outputStream.write(p.hashCode()))` (`write()` throws `IOException`), but you'd probably couldn't do it, because `Iterable.forEach()` is not declared as a method throwing `IOException`, so a compiler cannot know of these intentions. Sometimes checked exceptions are really harmful...
      singulars
    3. COI agree. It would be overkill to provide a second set of java.util.function classes that declare that they throw a (checked) Exception. Especially since we'd need two versions of every method with a function parameter - one that throws and one that doesn't. That goes a long way toward explaining why Scala doesn't have checked exceptions (only unchecked). Java 8 is a copy of Scala's lambdas with a `->` instead of `=>`. I wonder if Martin Odersky suggested any of this while he was working at Sun? I hope Java 9 includes immutable versions of most of their API classes.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload