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=0.1 required=5.0 tests=BAYES_05,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,689ab254fbb71c5 X-Google-Attributes: gid103376,public From: sgb@erlang.praxis.co.uk (Stephen Bull) Subject: Re: Help on deciding a data type. Date: 1996/09/04 Message-ID: #1/1 X-Deja-AN: 178416630 sender: sgb@praxis.co.uk references: <322C50E0.167E@sdrc.com> organization: Praxis plc newsgroups: comp.lang.ada Date: 1996-09-04T00:00:00+00:00 List-Id: Sreedhar Chintalapaty writes: Is there a way to define some data type here that would let me exploit the modular mathematics capability of Ada while at the same time having some representation for the * in the first entry? Or do I have to resort to definig it as, for instance type Symbol is Integer range -1..N; and write my own methods to overload the multiplication and division functions? I would suggest defining a record type with two fields: the first is a flag indicating whether the second is a valid value: type T is record Valid : Boolean; Value : Symbol; end record; -- ----------------------------------------------------------------------------- Stephen Bull Praxis Critical Systems 20 Manvers Street BATH BA1 1PX UK +1225 444700 (switchboard) +1225 739286 (direct) +1225 739281 (fax) ----------------------------------------------------------------------------- -- ----------------------------------------------------------------------------- Stephen Bull Praxis Critical Systems 20 Manvers Street BATH BA1 1PX UK +1225 444700 (switchboard) +1225 739286 (direct) +1225 739281 (fax) -----------------------------------------------------------------------------