comp.lang.ada
 help / color / mirror / Atom feed
From: matthew_heaney@acm.org (Matthew Heaney)
Subject: Re: an array of records within an array of records
Date: 1998/04/15
Date: 1998-04-15T00:00:00+00:00	[thread overview]
Message-ID: <matthew_heaney-ya023680001504981639150001@news.ni.net> (raw)
In-Reply-To: 6h307q$5qj@top.mitre.org


In article <6h307q$5qj@top.mitre.org>, mfb@mbunix.mitre.org (Michael F
Brenner) wrote:

>Yes, record initialization is a little long-winded, and is even
>more so when you make it more readable by adding in the field names:
>  
>  x := (CD=> 190, title => to_20 ("White Album"), author => to_20("Beatles"));
>
>Although it is long-winded, giving the field names can be very helpful
>if you come back to the data years later and wonder what is being
>filled in. 

Here's a case where using the identity operator as a constructor can
improve things:

x := (CD => 190, title => +"White Album", author => +"Beatles");

In general, when you have a subprogram (or record type) that has parameters
(components) of the same type (as you do here, with type String), then it's
safer to use named notation, so you don't accidently assign the wrong
value.




  reply	other threads:[~1998-04-15  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-14  0:00 an array of records within an array of records R Mullen
1998-04-15  0:00 ` Michael F Brenner
1998-04-15  0:00   ` Matthew Heaney [this message]
1998-04-16  0:00     ` Tom Moran
1998-04-16  0:00       ` Matthew Heaney
replies disabled

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