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,8a6e6d9458ae6ddc X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news.zanker.org!nntp.idg.pl!newsfeed.gazeta.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: Wojtek Narczynski Newsgroups: comp.lang.ada Subject: Re: Is this a bug? Date: Fri, 24 Sep 2004 14:37:05 +0200 Organization: tp.internet - http://www.tpi.pl/ Message-ID: References: <5ad0dd8a.0409221652.6a69b336@posting.google.com> <5ad0dd8a.0409230035.337f9305@posting.google.com> <2rg6a1F1arg02U1@uni-berlin.de> NNTP-Posting-Host: host-ip178-211.crowley.pl Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: nemesis.news.tpi.pl 1096029180 9517 62.111.211.178 (24 Sep 2004 12:33:00 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Fri, 24 Sep 2004 12:33:00 +0000 (UTC) User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Xref: g2news1.google.com comp.lang.ada:4097 Date: 2004-09-24T14:37:05+02:00 List-Id: Hello, > If so, then "renames" isn't quite as simple as I thought. It is more > like a "hard link" then a "symbolic link". i.e. it links to the object > rather then the name of the object. Interesting. Ada rename is not like C #define. Big thanks to the makers of Ada for this. It is more apparent what's going on in my code if you move the elaboration time initialization of Current_Hook to execution time: is Current_Hook : Bucket_Access_Access; -- Current : Bucket_Access renames Current_Hook.all; -- XXX Uncommented and used causes null pointer dereference begin Current_Hook := Queue.Anchor'Unchecked_Access; This yields immediate failure. Another example is: procedure Test_Rename is Arr : array (1..3) of Integer := (1,2); Ind : Positive := Arr'First; Curr : Integer renames Arr (Ind); begin Put_Line (Curr); Ind := Arr'Last; Put_Line (Curr); end; This will print 1 twice. Those #defines are one of the main reasons why C code so hard to read and debug, so I prefer to do some more typing. Regards, Wojtek