comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <sb463ba@l1-hrz.uni-duisburg.de>
Subject: Re: What exactly is a 'record' in Ada 95?
Date: Wed, 8 Sep 2004 13:40:15 +0000 (UTC)
Date: 2004-09-08T13:40:15+00:00	[thread overview]
Message-ID: <chn23v$hl0$4@a1-hrz.uni-duisburg.de> (raw)
In-Reply-To: chmtr8$6lp$06$1@news.t-online.com

matthias_k <nospam@digitalraid.com> wrote:
: So, what is a 'record' in Ada? Do I have to think about it like
: a struct in C? It seems to serve the same purpose. Is 'record' the
: only type modifier? Where are the differences?

For values of a record type, there are useful notations.
For example, a two component record value might be written as

  (name => "Frank", age => 56)

or alternatively

  (age => 56, name => "Frank")

or alternatively

  Person'(name => "Frank", age = 56)

or altenatively

  Person'("Frank", 56)

or just

  ("Frank", 56)


I'll leave it to you to find out what other alternatives there are,
if any.
In any case the compiler will check that _all_ record components get
values.

-- Georg




  parent reply	other threads:[~2004-09-08 13:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-08 12:27 What exactly is a 'record' in Ada 95? matthias_k
2004-09-08 12:58 ` Jim Rogers
2004-09-08 18:05   ` matthias_k
2004-09-08 13:12 ` Marc A. Criley
2004-09-08 18:08   ` matthias_k
2004-09-08 13:30 ` Peter Hermann
2004-09-08 18:09   ` matthias_k
2004-09-09 12:06     ` Peter Hermann
2004-09-18  4:14     ` Richard Pennington
2004-09-08 13:40 ` Georg Bauhaus [this message]
2004-09-08 18:22 ` Dmitry A. Kazakov
replies disabled

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