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 X-Received: by 10.50.62.49 with SMTP id v17mr36323718igr.1.1447347594073; Thu, 12 Nov 2015 08:59:54 -0800 (PST) X-Received: by 10.182.28.129 with SMTP id b1mr159312obh.4.1447347594052; Thu, 12 Nov 2015 08:59:54 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!i2no874281igv.0!news-out.google.com!l1ni2017igd.0!nntp.google.com!i2no874271igv.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 12 Nov 2015 08:59:53 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=94.107.233.114; posting-account=6m7axgkAAADBKh082FfZLdYsJ24CXYi5 NNTP-Posting-Host: 94.107.233.114 References: <7ba56b33-28d4-42d2-8b9b-5ad9f5beab8b@googlegroups.com> <87io597447.fsf@theworld.com> <66278720-249a-4191-a908-bb840e7f3ccc@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <272d6ba6-869f-427d-9395-51dd1d480a3c@googlegroups.com> Subject: Re: Bounded String question From: Serge Robyns Injection-Date: Thu, 12 Nov 2015 16:59:54 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:28319 Date: 2015-11-12T08:59:53-08:00 List-Id: On Wednesday, 11 November 2015 21:42:58 UTC+1, Jeffrey R. Carter wrote: > Sorry, I forgot the Drop parameter. Don't worry, this was very easy to resolve. I wish all my issues where tha= t easy. ;-) > These won't work. BS.Null_Bounded_String has type BS.Bounded_String, not = OS. > However, you can convert BS.Null_Bounded_String >=20 > No_OS : constant OS :=3D OS (BS.Null_Bounded_String); >=20 > or create your own >=20 > No_OS : constant OS :=3D To_String (""); I had both these version in my code (started with To_xyz ("") and then Null= _Bounded_String, as the later form is the one I like. My quest started whe= n I introduced pragma preelaborate. I started digging into the details wit= hout becoming any smarter, on the contrary. And asked my question here. > Calling To_String requires elaboration. I was foolishly hoping that these kind of elaborations could be preelaborat= ed. But the RM says not and the compiler slaps me. After working around a= s mentioned earlier in my discussions I was hit by another slap but this ti= me trying to preelaborate "simple" record types with my constants. So in t= he end, I throw the towel and leave it up to the compiler to figure out how= to elaborate my code. So far my attempt to hint and to have nice pure or = preelaborated packages. I'm left with a "hangover".=20 > --=20 > Jeff Carter > "When Roman engineers built a bridge, they had to stand under it > while the first legion marched across. If programmers today > worked under similar ground rules, they might well find > themselves getting much more interested in Ada!" > Robert Dewar > 62 >From your post, I do understand you are an authority when it comes to langu= age rules. Am I so mistaken to hope that today's compilers could be smarte= r in preelaboration besides plain strings and scalars? Is this something t= hat could be looked at in the next Ada revision? Serge