Pluggable type sytems

Michel Fortin michel.fortin at michelf.com
Mon Jan 19 05:26:47 PST 2009


On 2009-01-18 21:29:02 -0500, bearophile <bearophileHUGS at lycos.com> said:

> I think pluggable type systems will become more common in the following 
> years (see also the optional annotations of Python3 that are designed 
> for that too). This is more or less related:
> 
> http://bartoszmilewski.wordpress.com/2009/01/18/java-pluggable-types/

Nice post.

> (but nonnullability is so basic that it's better inside the language, 
> and not left out to a plug-in type system).

I agree for non-nullability.

In fact, I'd even argue that non-nullability should be the default for 
pointers and class references, because it is either safer (if the 
compiler doesn't do the null check for you) or less troublesome to use 
(if the compiler forces you to check for null everytime). Another 
reason being consistency: value-types can't be null by default and so 
should be class references and pointers. And making pointers 
non-nullable by default can only be done at the language level, so 
obviously it's better in the language than as a user-defined type 
modifier.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/




More information about the Digitalmars-d mailing list