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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fba47412041a3607 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!feeder.news-service.com!feeder3.cambrium.nl!feed.tweaknews.nl!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Differences with/without .all References: <647ktoF2acjggU1@mid.individual.net> Date: Mon, 17 Mar 2008 21:44:24 +0100 Message-ID: <871w696pxz.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:rh02DxAIfbKtd7tHbO7C+sHY00k= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Tele2 X-Trace: DXC=F14:?Q;lfaOUXiW92mU\2C6`Y6aWje^YJ@F9LGfo Alex R. Mosteo writes: > Hello people, > > Gnat is giving me an error depending on if I use the .all > abbreviation or not. I had the (unresearched) idea that there > should be no differences besides the aesthetic one[*], so I'm not > sure if gnat's wrong or I'm (guess what ;) ) > > One way or the other, I'd like to know the explanation. The > particular case that is giving me problems in GPL 2007 is: > > protected type Safe; > type Safe_Access is access all Safe; > function S return Safe_Access; > > S.Some_Procedure; > -- This fails with > -- Prefix of protected procedure or entry call must be variable > > S.all.Some_Procedure; > -- This compiles and runs OK. > > Your judgment? The compiler is correct. 6.4(9): "When there is an actual_parameter_part, the prefix can be an implicit_dereference of an access-to-subprogram value." In other words, in the absence of actual parameters, you must use an explicit_dereference, i.e. you must specify ".all". -- Ludovic Brenta.