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,15a453f8241a09c5 X-Google-Attributes: gid103376,public From: wheeler@aphrodite.csed.ida.org (David Wheeler) Subject: Re: Booelan Function and sizeof operator Date: 1996/04/12 Message-ID: <4kmns4$9bg@dmsoproto.ida.org>#1/1 X-Deja-AN: 147211518 references: organization: IDA, Alexandria, Virginia newsgroups: comp.lang.ada Date: 1996-04-12T00:00:00+00:00 List-Id: EMANUELE COSTA (costa@UNIX.LANCS.AC.UK) wrote: : Hi everybody, : I would like to know, if I can find something similar to the C : sizeof operator and boolean functions on integer in Ada. If : this is not the case how could I write something equal in Ada? sizeof(int) ===> Integer'Size I'm not sure what you mean by "boolean functions on integer". If you want to _convert_ a Boolean to Integer, you can use 'Pos: bool x; ==> X : Boolean; printf("%d", (int) x); Put(X'Pos); If you mean "and", "or", etc., you can define a packed array of Booleans and perform operations on the array. In Ada 95, you can also use modular types for "and", "or", etc. --- David A. Wheeler Net address: wheeler@ida.org