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,3d6ef988ec3a5ef7 X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Re: renaming Interfaces.Java.Ada_To_Java_String to the + operator Date: 1998/01/25 Message-ID: #1/1 X-Deja-AN: 319135036 Content-Transfer-Encoding: 8bit References: <199801191436.PAA25860@basement.replay.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1998-01-25T00:00:00+00:00 List-Id: In article <199801191436.PAA25860@basement.replay.com>, nobody@REPLAY.COM (Anonymous) wrote: >I've been developing software professionally since 1975, and using Ada >since 1984, and I only recently encountered this "old idiom" by reading >about it here. Perhaps it is familiar only to those involved in the >language design and implementation. I know I never encountered it in 14 >years of reading the ARM, Ada texts, and Ada-related articles. This technique was discussed in John Barnes' book, Programming In Ada. He used it to construct a ragged array of strings. Actually, that turns out to be a popular use of the identity operator, to populate an array: declare Aardvark : aliased constant String := "aardvark"; ... Elephant : aliased constant String := "elephant"; ... Zebra : aliased constant String := "zebra"; type String_Access_Constant is access constant String; type String_Array is array (Positive range <>) of String_Access_Constant; Animals : constant String_Array := (Aardvark'Access, ... Elephant'Access, ... Zebra'Access); begin This is more or less the example in John's book. (His Ada 83 example put the strings on the heap, using the identity operator to hide to allocator invokation.) -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271