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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,912597791e813f68 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-05 06:12:29 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!dialin-145-254-036-036.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: advantages or disadvantages of ADA over pascal or modula Date: Sun, 05 Jan 2003 15:12:54 +0100 Organization: At home Message-ID: References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-036-036.arcor-ip.net (145.254.36.36) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1041775948 14060698 145.254.36.36 (16 [77047]) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:32569 Date: 2003-01-05T15:12:54+01:00 List-Id: Steve wrote: > "Dmitry A. Kazakov" wrote in message > news:av6gr5$cgael$1@ID-77047.news.dfncis.de... >> Steve wrote: >> >> > Ada has no equivalent to Pascal's "with" statement (if you've > maintained >> > a >> > lot of Pascal code, you know why this is an advantage). >> >> In fact Ada 95 has an equivalent of Pascal's "with": >> >> X : Some_Type renames An.Extremely.Long.Path.Name.Object; > > After maintaining both Pascal and Ada code, I wholeheartedly disagree that > Ada's renaming is equivalent to Pascal's with. > > If you're trying to analyze Pascal code that looks something like: > > with a, b, c, d do > begin > field1 := fieldA > end; > > Tracking down where the !@** field1 and fieldA come from is non trivial. > In fact if these fields exist in more than one of the a, b, c, d records > it may be compiler dependent. > > With Ada's renaming you can easily track a field back to its source. You > may have to sift through a few renamings, but in practice this is easy to > do. I agree that Ada's "rename" is better than Pascal's "with". However they both are responses to same problem. And neither is ideal. For example, people often write something like: with Ada.IO_Exceptions; package My_IO is End_Error : exception renames Ada.IO_Exception.End_Error; and run into troubles when both Ada.IO_Exceptions and My_IO are "used". This causes some people to believe that "use" is inherently bad, which is not true. -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de