comp.lang.ada
 help / color / mirror / Atom feed
* Null record
@ 2003-08-16  4:54 Adrian Hoe
  2003-08-16  9:10 ` Preben Randhol
  2003-08-16 12:58 ` Matthew Heaney
  0 siblings, 2 replies; 3+ messages in thread
From: Adrian Hoe @ 2003-08-16  4:54 UTC (permalink / raw)


Hi,

Just a silly question.

A null record can be implemented as follow:

Method 1:

type Blank is new Some_Record with null record;




Method 2:

type Blank is new Some_Record with
    record
       null;
    end record;


Which is the most popular form and why? I assume personal preference 
influences the choice.

Regards,




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Null record
  2003-08-16  4:54 Null record Adrian Hoe
@ 2003-08-16  9:10 ` Preben Randhol
  2003-08-16 12:58 ` Matthew Heaney
  1 sibling, 0 replies; 3+ messages in thread
From: Preben Randhol @ 2003-08-16  9:10 UTC (permalink / raw)


Adrian Hoe wrote:
> Hi,
> 
> Just a silly question.
> 
> A null record can be implemented as follow:
> 
> Method 1:
> 
> type Blank is new Some_Record with null record;
> 
> Method 2:
> 
> type Blank is new Some_Record with
>     record
>        null;
>     end record;
> 
> 
> Which is the most popular form and why? I assume personal preference 
> influences the choice.

I think Method 1 was made particularily for this usage. I would say
Method 1 as Method 2 looks like incomplete code if you consider:

   procedure Do_Something_Callback (Object : T) is
   begin
      null;
   end Do_Something_Callback;

which could be automatically generated from a spec file.

-- 
�I think fish is nice, but then I think that rain is wet.
 So who am I to judge.�
                 - The Hitch Hiker's Guide to the Galaxy (radioplay)



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Null record
  2003-08-16  4:54 Null record Adrian Hoe
  2003-08-16  9:10 ` Preben Randhol
@ 2003-08-16 12:58 ` Matthew Heaney
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Heaney @ 2003-08-16 12:58 UTC (permalink / raw)


"Adrian Hoe" <mailbox@nospam.adrianhoe.com.my> wrote in message
news:3f3db971_1@news.tm.net.my...

> Which is the most popular form and why? I assume personal preference
> influences the choice.

Method #1.







^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-08-16 12:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-16  4:54 Null record Adrian Hoe
2003-08-16  9:10 ` Preben Randhol
2003-08-16 12:58 ` Matthew Heaney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox