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 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!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Need a way to convert a constant to a variable Date: Sat, 5 Aug 2017 22:12:09 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 5 Aug 2017 20:08:02 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="e2d8a2245c1ff735efa82028d286fec1"; logging-data="2806"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+v3CQBp1OgkPjXuTduGElCH3ZWhhmkX7A=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 In-Reply-To: X-Antivirus-Status: Clean Content-Language: en-US X-Antivirus: AVG (VPS 170804-2, 08/04/2017), Outbound message Cancel-Lock: sha1:7HTjBYESujTZ/NXZxmSgqvyMuiw= Xref: news.eternal-september.org comp.lang.ada:47620 Date: 2017-08-05T22:12:09+02:00 List-Id: On 08/05/2017 06:25 PM, Victor Porton wrote: > > Your code allocates a new string which requires to be freed later. > > I want a function, which would return a pointer to the (not necessarily nul- > terminated) string hold in the indefinite holder, so that deallocation would > be not required and code would be more efficient (not requiring to copy the > char_array). You made a proposal to the ARG, and I showed that the problem in that proposal that you claim cannot be solved with the existing language can be. The ARG aren't going to look at the problem you have in your mind, they're going to look at the problem in your proposal. Since it can be so solved, the ARG will reject it. But even if you clean it up to include all your internal requirements I still think it won't fly. Ada is a safe language, and a blatantly unsafe feature such as you are requesting will only be considered if it is applicable to a large set of real problems. Not only that, but you'll need to show that this large set of real problems has many with real size and timing requirements that can't be met using my solution. In other words, all your requirements must be realistic, not premature optimization. The ARG is going to need be told why in these problems the functions can't have an in-out parameter, for example. So I think your proposal will fail on that count. Furthermore, your only example uses a container from the standard library. The containers are intended to be general purpose and safe. They are not expected to be usable for every problem. So your large set of real problems will have to have this problem not in connection with the containers. Otherwise they'll say that if the containers are not suitable for your problem, don't use them. Even if you can show all this, I still think it won't fly, because I know a way to do what you want within the existing language. I suggest your effort would be better spent considering alternative designs. -- Jeff Carter "He didn't get that nose from playing ping-pong." Never Give a Sucker an Even Break 110 --- This email has been checked for viruses by AVG. http://www.avg.com