NULLs

Hans-Dieter.Dreier@materna.de Hans-Dieter.Dreier@materna.de
Mon, 19 Jul 1999 11:34:28 +0200


--HTDGPvC97ZvaE7bdoI5o9egm7E3xUWCH
Content-type: text/plain; charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

>
>
>Hans-Dieter.Dreier@materna.de wrote:
>
>> Anyway, as long as no check has been made, the compiler will allow only
>operations of the the most derived common ancestor of both ref and null
>because that is the best guess it can make.
>>
>
>So in this case it wouldn't allow any operations until the check was
>performed. Unless of course, NULL was a derivative of Object (or Any or
>whatever your base class for all classes in the language might be named).

Any operations that are defined for that pointer class, are allowed without=
 prior checking. E.g. you could assign the pointer to another pointer (as l=
ong as the types-being-pointed-to were compatible, which would be checked b=
y a precondition of the assignment operator).

>> If the right hand side of the definition contains a "|" (meaning "...or =
may
>be a..." in this case), there is no  direct inheritance involved. Maybe it
>would have been better to pick another syntax altogether.
>>
>
>If it can lead to confusion, and it obviously did in this case, it should =
be
>changed. I do realize these are simply examples and not any definitive syn=
tax.
>
>How about:
>
>class pointer <a>  :? ref <a> | null
>
That's OK with me. As you said above, it's no definitive syntax.

>It looks funny but you definitely won't be confusing it with inheritance.
>
>[...]
>
>Jason.
>
>
>


--

Regards,

Hans-Dieter Dreier
(Hans-Dieter.Dreier@materna.de)=

--HTDGPvC97ZvaE7bdoI5o9egm7E3xUWCH
Content-type: text/plain; charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

IDENTIFIKATIONSANGABEN:
a15268a.txt IA5 DX-MAIL X.400 User Agent=

--HTDGPvC97ZvaE7bdoI5o9egm7E3xUWCH--