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,f868292008c639ce X-Google-Attributes: gid103376,public From: Keith Thompson Subject: Re: C vs. Ada - strings Date: 2000/05/22 Message-ID: #1/1 X-Deja-AN: 626151569 Sender: kst@king.cts.com References: <390F0D93.F835FAD9@ftw.rsc.raytheon.com> <8en5o9$ihe$1@nnrp1.deja.com> <8eonos$e70$1@wanadoo.fr> <1fIU4.4668$Rx3.250161@typhoon.nyroc.rr.com> <8g8p31$a2s$1@nnrp1.deja.com> X-Trace: thoth.cts.com 959060795 46517 205.163.0.22 (23 May 2000 05:46:35 GMT) Organization: CTS Network Services Newsgroups: comp.lang.ada X-Complaints-To: newsmaster@cts.com Date: 2000-05-22T00:00:00+00:00 List-Id: Robert A Duff writes: [...] > Oh, one other thing: 'Img, being a GNAT invention, *could* have > eliminated the annoying extra blank. Why didn't you? TeleSoft's old TeleGen2 compiler had a set of extended attributes: 'Extended_Image, 'Extended_Value, 'Extended_Width, etc. The 'Extended_Image attribute, for example, could be applied to any scalar type, including floating-point (this was Ada 83, so there was no Float'Image), and had several extra parameters with reasonable defaults. Integer'Extended_Image(X) would give you the image of X with no leading spaces; Integer'Extended_Image(X, 10) would give you the image of X padded with leading blanks to 10 characters. They were provided mostly to be used in the implementation of Text_IO, but they were very useful in their own right. I was disappointed that something like this wasn't included in the Ada 95 standard. There were two problems: named parameters weren't supported, and the fact that Integer'Extended_Image and Enum'Extended_Image had different parameter profiles cause an ambiguity when used with a generic discrete type. -- Keith Thompson (The_Other_Keith) kst@cts.com San Diego Supercomputer Center <*> Welcome to the last year of the 20th century.