From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6501d9f1c65bd0d1 X-Google-Attributes: gid103376,public From: Ken Garlington Subject: Re: Ada 83: Type defaults Date: 1996/09/12 Message-ID: <32381A53.3FF8@lmtas.lmco.com>#1/1 X-Deja-AN: 180213114 references: <516mkh$d3m@ryker.dma.gov> content-type: text/plain; charset=us-ascii organization: Lockheed Martin Tactical Aircraft Systems mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.02 (Macintosh; I; 68K) Date: 1996-09-12T00:00:00+00:00 List-Id: hehmeyerj wrote: > > This may be a simple problem but... > > I have an enumeration type declaration. For example: > > type x is (A, B, C, D); > > And I have about three hundred variables of type x scattered throughout > 50 packages. How would you default the type to, say A, without going > to each individual variable declaration and explicitly defaulting them. > (ie y : x := A;) > > TIA There's the "wrap a record around it" solution (see other posts). There's the "Make X an abstract data type" solution, which doesn't really make the typing easier, but it can be used to _ensure_ that every variable of type X is given the same default value. Also, there's the solution that begins: 1. Upgrade to Ada 95... :) -- LMTAS - "Our Brand Means Quality"