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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,206123971e05e480 X-Google-Attributes: gid103376,public From: marciant@newshost.li.net (Vincent Marciante) Subject: Re: "constant X renames" (language-lawyers) Date: 1996/12/13 Message-ID: <58ql5k$h9u@linet06.li.net>#1/1 X-Deja-AN: 203835651 references: <9612111834.AA12317@most> organization: LI Net (Long Island Network) newsgroups: comp.lang.ada Date: 1996-12-13T00:00:00+00:00 List-Id: Just leave out "constant" the renaming will work. I sometimes rename subprogram parameters in the body by design; It is a way to choose a parameter name that makes a call of the subprogram readable yet also use a name in the body that makes the implementation more readable. That way the name that is the best from the particular point view can be used! procedure Get (The_Value : out Value; After_Checking_The_Source : in Source) is The_Source : Source renames After_Checking_The_Source; begin if The_Source = ... The_Value := ... else ... end if; end Copy; W. Wesley Groleau (Wes) (wwgrol@PSESERV3.FW.HAC.COM) wrote: : procedure Proc ( Stupid_Name : in Param_Type ) is : Sensible_Name : constant Param_Type renames Stupid_Name; : -------------------- : This is illegal by LRM 83 8.5 (2) and LRM 95 8.5.1 (2) because "constant" : is not part of a (sub)type mark. The restriction makes sense in a way, : since the item is already a constant and if it weren't we still can't : change its properties by renaming. Still, it surprised me after : nearly ten years of Ada programming. (I wouldn't have even tried it if : my predecessor had used a better name.)