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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5117b1b6391a0e06 X-Google-Attributes: gid103376,public Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: A simple ADA puzzle (I haven't the answer) Date: Fri, 18 Jun 2004 16:01:06 +0200 Message-ID: References: <1087410710.477506@master.nyc.kbcfp.com> <1087474761.60413@master.nyc.kbcfp.com> <7o83d0hf6sqgng2980e1tg7iu864m5m50u@4ax.com> <1in5d05aa4rfqlt7e76gk87ucd3vuru6pm@4ax.com> <1087564576.388973@master.nyc.kbcfp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de pa8ieUEXjjkbzu21H0ULdgKXu6o5kq763f/nIUyeapGx/uqL8= X-Newsreader: Forte Agent 1.8/32.548 Xref: g2news1.google.com comp.lang.ada:1662 Date: 2004-06-18T16:01:06+02:00 List-Id: On Fri, 18 Jun 2004 09:16:16 -0400, Hyman Rosen wrote: >Dmitry A. Kazakov wrote: >> Which proves that Local is defined on the library level, same as in >> Ada. The only difference is that C++ fakes you out, while Ada tells >> the sad truth. > >It is not "defined on thelibrary level", whatever that might >mean in C++. It does not have external linkage (so it cannot >be used as a template parameter) and it may access anything >from its scope other than automatic variables and parameters. > >In C++ all types are static entities. They never depend on >automatic variables or runtime properties, and so there is >never a problem with objects of those types persisting after >the scope in which those types are defined is exited. So no matter how we call it, the situation does not much differ from what we have in Ada. You cannot access local scope from that type. Neither in C++ nor in Ada. BTW, I by no means advocate Ada. I think that it might be very useful to lift that limitation. But that is not very easy to do consistently and efficient. Nevertheless, Ada is at least honest about this matter with the programmer. -- Regards, Dmitry Kazakov www.dmitry-kazakov.de