questions on nullability

Nicolas Cannasse ncannasse at motion-twin.com
Fri Jun 16 14:02:59 PDT 2006


> At the risk of being tangential, is there any value in generalising the 
> nullability concept into a pseudo type, which may be defined as the 
> union of some set of types, with a further set of types removed?
> 
> Re-using the + and - operators, it could be something like:
> 
> function add(a:(Number+Complex-Null), b:(Number+Complex-Null)):Complex{
>   if(a is Number){
>      a = new Complex(a, 0);
>   }
>   return a.add(b);
> }

As far as I know, "null" is a value, not a type.

Nicolas



More information about the Es4-discuss mailing list