Patterns design question: Primitive type tests

Mark Raynsford mark at io7m.com
Sat Nov 4 20:55:07 UTC 2017


On 2017-11-03T21:30:17 +0100
Remi Forax <forax at univ-mlv.fr> wrote:

> I'm happy with choice #3 too. 
> 

Seconded. 

On 2017-11-03T15:37:20 -0400
Brian Goetz <brian.goetz at oracle.com> wrote:
>
>  - There isn't really an overwhelming need for being able to say "Is 
> this Object a numeric zero" or "Is this object a boxed primitive in the 
> range of int."

I agree. From my experience, despite the best efforts of autoboxing,
many programmers treat primitives and references as being from entirely
separate worlds. I'd therefore not really expect people to be matching
on arbitrary things and relying on quiet primitive conversions behind
the scenes to get the behaviour they want.

This is obviously purely subjective!

-- 
Mark Raynsford | http://www.io7m.com



More information about the amber-spec-experts mailing list