NULLs

Hans-Dieter.Dreier@materna.de Hans-Dieter.Dreier@materna.de
Fri, 16 Jul 1999 17:58:35 +0200


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

(Forwarding a message from jason@injektilo.org)



Hi.

Hans-Dieter.Dreier@Materna.DE wrote:

> You would define a parameterized class from the predefined parameterized =
class "ref" that does not allow NULL pointers:
>
> class pointer <a> : ref <a> | null;
>
> pointer <int> ptr1;
> ref <int> ptr2;
>
> ptr1 allows NULLs, ptr2 doesn't.
>

This could be a problem. I'm assuming that you're declaring that pointer de=
rives from ref, correct? If that's the case, then any operation that accept=
s a ref as a parameter will expect that parameter not to be null. If you pa=
ss in a pointer (which
should be ok because pointer is a subtype of ref) it could possibly be null=
 and your operation won't even bother to check for this because it thinks i=
t only has a ref.

I think that you really want the pointer class to be a supertype of ref. Th=
is would prevent you passing a pointer to an operation that required a ref.=
 Sather has this concept although I've only read about it so couldn't tell =
you how well it works in
practice.

>
> I only mentioned this because you might see examples of mine using simila=
r syntax. For now, every syntax is OK for discussion purposes as long as we=
 understand the meaning - I think we should not get involved into a discuss=
ion about syntax here.
>

Agreed and understood. Syntax is important--just like the GUI for any appli=
cation--but it's the semantics that really counts.

>
>
> Do you mind if I cross-post our recent conversation to the Ultra mailing =
list?
> If we post to that list, we could let the others participate. They certai=
nly have interesting things to say.
>

Go for it. When I intially replied I thought I was replying to list but the=
 web-based mail reader I was using from work apparently can't reply to all.

Jason.




--

Regards,

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

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

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

--xbHk5r0jrNdugTp9k8rgZAGu92HJAqIp--