comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Array of records with default values not propagating to array
Date: Sun, 4 Feb 2018 11:19:56 +0100
Date: 2018-02-04T11:19:56+01:00	[thread overview]
Message-ID: <p56moc$5hf$1@dont-email.me> (raw)
In-Reply-To: <f326b46d-0ca2-45a8-94b7-bb27b52e54b9@googlegroups.com>

On 02/03/2018 12:06 PM, Bojan Bozovic wrote:
> When I defined a record, and set a default value for some of its components, these don't propagate when I make array of these records. Here is code that can be compiled, but I wonder do I need to explicitly assign value for 'others' in 'Initialize' procedure. This has nothing to do with Ada random number generation, I might have as well used Ada.Numerics.Float_Random, or the reusable code that was posted in another thread, with the same result, so I will post in this separate thread. When I omit "others =>" in Initialize, I get compilation errors at these lines both on FSF compiler and AdaCore GPL compiler on Windows. Is this intended behavior or I am missing something?

I'm not sure what you're experiencing. Your code, as given, compiles and works 
fine for me.

-- 
Jeff Carter
"I like it when the support group complains that they have
insufficient data on mean time to repair bugs in Ada software."
Robert I. Eachus
91


      parent reply	other threads:[~2018-02-04 10:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-03 11:06 Array of records with default values not propagating to array Bojan Bozovic
2018-02-03 14:16 ` Jere
2018-02-03 14:54   ` Bojan Bozovic
2018-02-03 15:26   ` Simon Wright
2018-02-03 16:07     ` Jere
2018-02-04  9:21     ` Niklas Holsti
2018-02-04  9:32       ` Simon Wright
2018-02-04  2:43 ` Robert Eachus
2018-02-04  4:59 ` Bojan Bozovic
2018-02-04  9:34   ` Simon Wright
2018-02-04 10:07   ` Niklas Holsti
2018-02-04 11:38     ` Bojan Bozovic
2018-02-04 10:19 ` Jeffrey R. Carter [this message]
replies disabled

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