Primitive streams and optional (original) (raw)
Remi Forax forax at univ-mlv.fr
Sat Nov 24 14:06:34 PST 2012
- Previous message: Primitive streams and optional
- Next message: Primitive streams and optional
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 11/24/2012 06:13 PM, Doug Lea wrote:
Summary: get rid of Optional. Use null consistently to mean nothing there (plus exceptions in exceptional cases). Use the standard boxed types for numerics. Until/unless there is are value types, create intStream etc as a separate set of classes with merely analogous APIs. (And while we are at it, add LongKeyHashMap and a few others!) Don't worry about people who used null as "meaningful" elements, map keys or map values. No one is forcing them to use streams.
-Doug
Just to be crystal clear, I disagree with Doug that stream should throw a NPE in middle of it's implementation, if an item of a collection is null or if a lambda returns null, but I agree with him that the external API should not use Optional and use null to say nothing.
Rémi
- Previous message: Primitive streams and optional
- Next message: Primitive streams and optional
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the lambda-libs-spec-observers mailing list