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!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: A few questions Date: Mon, 16 Nov 2015 21:50:26 +0000 Organization: A noiseless patient Spider Message-ID: References: <5007b311-5d2e-448c-b8c8-fc2e2d88ea5e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="29a2b57997615acde1fccc73c72adb9b"; logging-data="24808"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/29msfNGUioMFpaYtPSjyMB+G/6F63eVA=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:BVFrVyLVCwuGEyDkDcEiOMREqDQ= sha1:cg1gyr7mOiLJxGvv/Jq40UQgDow= Xref: news.eternal-september.org comp.lang.ada:28409 Date: 2015-11-16T21:50:26+00:00 List-Id: "Randy Brukardt" writes: > Since 'Unrestricted_Access is GNAT junk, it's doesn't have any value > for a sample implementation (if you really need 'Unrestricted_Access, > then the interface can't be implemented in Ada, and that would be a > major problem.) So far as I know, you might need to use > 'Unchecked_Access, but that's necessary anytime one needs to get a > pointer to save the evaluated version of something. I can't of course speak for AdaCore, but I think that the problem is to do with obtaining a writable view of an in parameter; for example, in the Bounded Hashed Map (GCC 5) there is function Iterate (Container : Map) return Map_Iterator_Interfaces.Forward_Iterator'Class is B : Natural renames Container'Unrestricted_Access.all.Busy; begin return It : constant Iterator := (Limited_Controlled with Container => Container'Unrestricted_Access) do B := B + 1; end return; end Iterate; I dare say something could be done with 'Address and Address To Access Conversions.