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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a02:1810:: with SMTP id k16-v6mr3536263jad.21.1541680104113; Thu, 08 Nov 2018 04:28:24 -0800 (PST) X-Received: by 2002:aca:37c1:: with SMTP id e184-v6mr36495oia.5.1541680103739; Thu, 08 Nov 2018 04:28:23 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!85.12.16.69.MISMATCH!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!g188-v6no395179itg.0!news-out.google.com!n199-v6ni621itn.0!nntp.google.com!z5-v6no400221ite.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 8 Nov 2018 04:28:23 -0800 (PST) In-Reply-To: <0c992f78-0496-4d8c-b046-fd75aae32599@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=165.225.84.80; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S NNTP-Posting-Host: 165.225.84.80 References: <5af3c4a0-5856-47ec-bb05-0ae9f9bb24ff@googlegroups.com> <0c992f78-0496-4d8c-b046-fd75aae32599@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Trivia: Ada packages are great! From: Maciej Sobczak Injection-Date: Thu, 08 Nov 2018 12:28:24 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 2368 X-Received-Body-CRC: 3319921343 Xref: reader02.eternal-september.org comp.lang.ada:54793 Date: 2018-11-08T04:28:23-08:00 List-Id: > Now, the discussion about files has overshadowed the initial point of this thread: in Ada, *everything* must be inside a unit (package, procedure or function) with a name, and *that* is an extremely useful feature compared to "flat" languages! Not exactly. It is possible to write a program as a set of procedures that do not exist in any package (starting from the program entry procedure). This is no different from having a set of free-standing functions in C or C++ at the global namespace: -- test.adb: with Ada.Text_IO; with Foo; procedure Test is begin Ada.Text_IO.Put_Line ("Test"); Foo; end Test; -- foo.adb: with Ada.Text_IO; procedure Foo is begin Ada.Text_IO.Put_Line ("Foo"); end Foo; GNAT accepts this with Test as a starting point. No specification files, no packages. Even "with Foo;" works fine without any separate spec file. Hey, we are closer to the obfuscated Ada context! -- Maciej Sobczak * http://www.inspirel.com