comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Single element arrays as function parameters
Date: Mon, 13 Jun 2011 07:49:55 -0700 (PDT)
Date: 2011-06-13T07:49:55-07:00	[thread overview]
Message-ID: <432eff12-4b4c-44b3-ae26-fc3468f4ebce@34g2000pru.googlegroups.com> (raw)
In-Reply-To: Q7udnaOaorPPwm7Q4p2dnAA@giganews.com

On Jun 11, 5:28 am, "Peter C. Chapin" <PCha...@vtc.vsc.edu> wrote:
> On Fri, 10 Jun 2011 22:11:49 +0200, Mart van de Wege wrote:
>
> > If I look at the language documentation, I'm guessing that this is
> > because a single element array does not get recognised as being of type
> > MM_Subtype, which is defined as
>
> > type MM_Subtype is array(Natural range <>) of Possible_MM_Subtype;
>
> > What *is* the best way to store an attribute which may be either a
> > single enumeration element or a list of enumeration elements?
>
> What about qualifying the aggregate:
>
>    MM_Subtype'(Dwarf)

No, that's still illegal.  Since MM_Subtype is an array subtype,
(Dwarf) has to have the syntax of an aggregate, which means you still
need a named association:

    MM_Subtype'(1=>Dwarf)

                                -- Adam



      reply	other threads:[~2011-06-13 14:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-10 20:11 Single element arrays as function parameters Mart van de Wege
2011-06-10 20:54 ` J-P. Rosen
2011-06-10 21:28   ` Mart van de Wege
2011-06-10 21:58     ` Adam Beneschan
2011-06-10 22:24       ` Mart van de Wege
2011-06-11 12:28 ` Peter C. Chapin
2011-06-13 14:49   ` Adam Beneschan [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