The D Programming Language

Richard Tobin richard at aiva.ed.ac.uk
Fri Feb 26 03:43:09 AEST 1988


In article <915 at PT.CS.CMU.EDU> edw at IUS1.CS.CMU.EDU (Eddie Wyatt) writes:
>> >I think I would also drop the convention that 0 is a null pointer.  Make
>> >"null" a keyword, representing a null pointer of any type.
>> This would, at one stroke, eliminate half the confusion that plagues
>> comp.lang.c ....  (about 1/3 :-) )
>  Unless you require function prototypes to be within scope, null
>will not do you much good.

Ah, but if you you don't make the representation of the null pointer
be the same as that of an integer (or anything else) then you can make
it illegal to pass it (uncast) to a function for which there is no
prototype.  You can't do that with zero, unless you want to have to say
(int)0 to pass an integer zero.

Of course, when designing a new language you certainly could require
that functions never be used unless there is a prototype (or
"declaration" as one might call it) in scope.

-- Richard
-- 
Richard Tobin,                         JANET: R.Tobin at uk.ac.ed             
AI Applications Institute,             ARPA:  R.Tobin%uk.ac.ed at nss.cs.ucl.ac.uk
Edinburgh University.                  UUCP:  ...!ukc!ed.ac.uk!R.Tobin



More information about the Comp.lang.c mailing list