comp.lang.ada
 help / color / mirror / Atom feed
* Advent of Code Day 7
@ 2020-12-07 23:03 John Perry
  2020-12-07 23:44 ` Randy Brukardt
  2020-12-08 11:25 ` Jeffrey R. Carter
  0 siblings, 2 replies; 6+ messages in thread
From: John Perry @ 2020-12-07 23:03 UTC (permalink / raw)


When doing today's exercise, I encountered an issue where I wanted to initialize only some fields of a record, with the other fields having a default initialization. In particular:

   type Bag_Entry is record
      Description: Bag_Description := "                    ";
      Quantity: Positive;
   end record;

  Entry: Bag_Entry := ( Quantity => 10 );

However, GNAT says this is invalid because I didn't specify Bag_Description. I looked in the ARM but didn't see anyplace that implies that; did I miss it? Is there a reason that Description can't be initialized automatically according to the rules above?

john perry

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

end of thread, other threads:[~2020-12-08 23:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07 23:03 Advent of Code Day 7 John Perry
2020-12-07 23:44 ` Randy Brukardt
2020-12-07 23:49   ` John Perry
2020-12-08 11:25 ` Jeffrey R. Carter
2020-12-08 16:55   ` John Perry
2020-12-08 23:25     ` Jeffrey R. Carter

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