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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3c55100a141db64d,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1993-03-19 09:12:12 PST Newsgroups: comp.lang.ada Path: sparky!uunet!math.fu-berlin.de!dww From: dww@math.fu-berlin.de (Debora Weber-Wulff) Subject: Membership in "set" of characters Message-ID: Sender: news@math.fu-berlin.de (Math Department) Organization: Free University of Berlin, Germany Date: Fri, 19 Mar 1993 17:06:19 GMT Date: 1993-03-19T17:06:19+00:00 List-Id: This is another one of those "why won't this work?" for the experts. I'm stumped. As far as I can decode the LRM and see from 2 textbooks I consulted, this ought to work. -- muell3.ada -- -- Why won't membership work here? -- with text_io; use text_io; procedure muell3 is type affirmatives is ('y', 'Y', 'j', 'J', 'o', 'O'); ch : CHARACTER; okay : Boolean; begin get (ch); -- The next statement gets flagged with -- type clash in membership test [LRM 4.5.2/10] okay := ch IN affirmatives; -- Is this because there's the clause -- for CHARACTER use (1, 2, ... 128) in the standard? end muell3; This one was one of my favorites in Pascal! I'm currently quite frustrated with the type system after writing a little program to calculate the return on investment. I had declared one type for the interest and one for the DM amount, one was a float and one was a fixed value. After hours of agony to get the conversion right as the silly FIXEDs needed an explicit conversion after each * and / I found that 1000 DM (FIXED) * 0.03 (FLOAT) was equal to 31.98 !!!. I'd love for the bank to calculate my interest that way! It finally worked when both were FLOAT values. Now all I wanted to add was a loop to calculate the values again, and I get blown out of the water by Meridian's 4.1 type checker again. Is it me? Is it Meridian? Or is this the agony of using Ada? 8 -- Debora Weber-Wulff, Professorin fuer Softwaretechnik snail: Technische Fachhochschule, FB Informatik, Luxemburgerstr. 10, 1000 Berlin 65 email: dww@informatik.tfh-berlin.dbp.de