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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: Victor Porton Newsgroups: comp.lang.ada Subject: unconstrained subtype in component declaration Date: Sun, 27 Jul 2014 18:13 +0300 Organization: Aioe.org NNTP Server Message-ID: NNTP-Posting-Host: rFX7cZOSaeuGGZI2vwQTaQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.12.4 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:21281 Date: 2014-07-27T18:13:00+03:00 List-Id: As I've told in my previous thread in c.l.a, I want a function to return two values. A fragment of my real code: type Filename_And_Fragment is record Filename: String; Fragment: String; end record; function URI_String_To_Filename_And_Fragment(Str: String) return Filename_And_Fragment; rdf-raptor-uri.ads:63:20: unconstrained subtype in component declaration The compiler does not accept this. What to do? (I do not want to create a full fledged object with access-to-String fields and Get_*() accessors and Unchecked_Deallocation in finalization.) Should I step back to "out" argument of a procedure instead of returning a record like this as a return value of a function? (there were reasons why this would be better). Or should I just add two discriminants to the record? After some practice with Ada, I feel that it is probably not that good as I thought earlier. -- Victor Porton - http://portonvictor.org