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,dd2ec8d5747df63b,start X-Google-Attributes: gid103376,public From: mr101@ccsr.cam.ac.uk (Michael Roe) Subject: Arrays of strings and Annex E Date: 1999/03/30 Message-ID: <7dqkmu$h6o$1@pegasus.csx.cam.ac.uk>#1/1 X-Deja-AN: 460749028 Sender: mr101@kamloops.ccsr.cam.ac.uk (Michael Roe) Organization: University of Cambridge, England Newsgroups: comp.lang.ada Date: 1999-03-30T00:00:00+00:00 List-Id: Recently, I needed a write a server that return a variable length list of variable-length strings as a result of a remote procedure call. If I had been using ASN.1 and OSI protocols, I would have written something like this: ListOfNames ::= SEQUENCE OF IA5String Instead of ASN.1, I was using Ada and Annex E. So I wrote something like this: with Ada.Strings.Unbounded; package String_RCI is pragma Remote_Call_Interface (String_RCI); type List_Of_Names is array (Integer range <>) of Ada.Strings.Unbounded.Unbounded_String; function Get_List return List_Of_Names; end String_RCI; Unfortunately, this doesn't work: Unbounded_String is a private type which can't be passed across a remote call interface in this way. I could have used ordinary strings, but then all of the strings would have to be the same length. For example: type List_Of_Names is array (Integer range <>) of String (1 .. Name_Length); I could have written something which replicates most of the functionality of Ada.Strings.Unbounded, but in a way which can be passed across a remote call interface. It's a shame that the language-defined string types like Ada.Strings.Unbounded weren't designed with Annex E in mind. Mike PS. At least, I *think* this is a problem with the language definition, rather than a misfeature of a particular implementation; if I thought this was a bug in GNAT or GLADE I'd have reported it in the usual way rather than discussing it in comp.lang.ada.