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,eab0dc0ffd808ffd X-Google-Attributes: gid103376,public From: nobody@REPLAY.COM (Anonymous) Subject: Re: array type conversio question Date: 1998/04/06 Message-ID: <199804061400.QAA01523@basement.replay.com>#1/1 X-Deja-AN: 341354152 Content-Transfer-Encoding: 7bit References: <352542b9.16876715@SantaClara01.news.InterNex.Net> X-001: Replay may or may not approve of the content of this posting X-002: Report misuse of this automated service to X-URL: http://www.replay.com/remailer/ Content-Type: text/plain; charset=us-ascii Organization: Replay Associates, L.L.P. Mail-To-News-Contact: postmaster@nym.alias.net Newsgroups: comp.lang.ada Date: 1998-04-06T00:00:00+00:00 List-Id: On Fri, 03 Apr 1998 20:13:15 GMT, tmoran@bix.com (Tom Moran) wrote: > How can I make the following into legitimate Ada 95 code? > with interfaces.c; > procedure test is > use interfaces.c; > type t is array(1 .. 5) of aliased char; > type r is record > title : t := t(to_c("abc") & (4 .. 5=>nul)); > stuff : integer; > end record; > begin > null; > end test; > ... The following is legal according to GNAT 3.10p1/Win95: with interfaces.c; procedure test is type t is array(1 .. 5) of aliased interfaces.c.char; type r is record title : t := "abc" & (4 .. 5=>interfaces.c.nul); stuff : integer; end record; begin null; end test; "Pesky use clauses," said Pooh. Interfaces.C.Char is a character type; therefore, T is a string type; that is, it is a one-dimensional array with components of a character type. String literals are defined for all string types. Eliminating the use clause eliminated potential ambiguity of "&", allowing this to compile cleanly. Jeff Carter PGP:1024/440FBE21 My real e-mail address: ( carter @ innocon . com ) "English bed-wetting types." Monty Python & the Holy Grail Posted with Spam Hater - see http://www.compulink.co.uk/~net-services/spam/