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,8fe003b966ed27e4 X-Google-Attributes: gid103376,public From: kst@aonix.com (Keith Thompson) Subject: Re: Newbe compile problems Date: 1996/12/19 Message-ID: #1/1 X-Deja-AN: 204914319 sender: news@thomsoft.com (USENET News Admin @flash) x-nntp-posting-host: pulsar references: organization: Aonix, San Diego, CA, USA keywords: ada compillation error newsgroups: comp.lang.ada originator: kst@pulsar Date: 1996-12-19T00:00:00+00:00 List-Id: In Sazonov Cyril writes: [...] > As for me I've found two places where may be errors: > > #1 >> with Float_Text_IO; > > Are you sure that this package exists? The standard package is called > TEXT_IO.FLOAT_IO. Text_IO.Float_IO is a generic package, not a package. Float_Text_IO should be Ada.Float_Text_IO, a predefined instantiation of Ada.Text_IO.Float_IO for type Float (this is new to Ada 95). (Incidentally, at least one Ada 83 compiler, RISCAda, provides a similar implementation-defined pre-instantiation called Float_Text_IO.) > Or if the IO package is of your own, then check whether its has been compiled > _before_ you're trying to compile your sample. > > #2 >> A, B : FLOAT := 0.0; > > This may an error too, the thing is that decimal IS NOT a sign of a FLOAT-type > constant, it is a sign of a FIXED-type constant. The FLOAT-type constant > should be written so 12.34E56, it IS to have a power_of_ten postfix. This > detail is mentioned in the LRM ( I've got the Ada83 one only ). No, that's incorrect. Ada doesn't have floating-point or fixed-point literals; it has real literals, which are of type universal_real. The decimal point is mandatory; the exponent part is optional. A real literal like 0.0 or 12.34E56 can be implicitly converted to any real (floating-point or fixed-point) type. Less precisely, floating-point and fixed-point literals have identical syntax. One possible source of confusion here is that Ada 95 allows a relaxed syntax (relative to Ada 83) for real literals on input. For example, Float_Text_IO.Get or Float'Value will accept any of "0.0", "0.", ".0", or "0". This relaxed syntax applies only to input, not to literals in Ada source programs. -- Keith Thompson (The_Other_Keith) kst@aonix.com <*> TeleSo^H^H^H^H^H^H Alsy^H^H^H^H Thomson Softw^H^H^H^H^H^H^H^H^H^H^H^H^H Aonix 10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2706 "SPOON!" -- The Tick