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,997e6472f58cc955,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-02 22:05:36 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!newsfeed.news2me.com!cyclone1.gnilink.net!spamkiller.gnilink.net!nwrddc03.gnilink.net.POSTED!da33a4ab!not-for-mail From: Fionn mac Cuimhaill Newsgroups: comp.lang.ada Subject: Case dependence and coding standards Message-ID: <035odv8mfiksmqo69q0250qp141oebtdro@4ax.com> X-Newsreader: Forte Agent 1.91/32.564 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 03 Jun 2003 05:05:36 GMT NNTP-Posting-Host: 4.3.232.129 X-Complaints-To: abuse@verizon.net X-Trace: nwrddc03.gnilink.net 1054616736 4.3.232.129 (Tue, 03 Jun 2003 01:05:36 EDT) NNTP-Posting-Date: Tue, 03 Jun 2003 01:05:36 EDT Xref: archiver1.google.com comp.lang.ada:38433 Date: 2003-06-03T05:05:36+00:00 List-Id: With regards to the thread about case dependence - no, no, a thousand times no! Keep Ada the way it is. I *would* like to see a fairly simple way of getting the compiler to enforce coding standards. I frequently annoy myself by writing something like Put_line when I intended to to write Put_Line. It would be nice to be able to specify some kind of coding standard dictionary as an appendage to a package or procedure. The source code of the dictionary could use an Ada-like syntax. For example, consider a package named My_Package. A coding standard dictionary might look something like this: -- Coding standards for XYZ Software, Inc. dictionary My_Package is -- Identifiers not in the dictionary -- Look_Like_This default mixed; -- reserved words must be uppercase; if -- this is not specified, everything would be mixed reserved upper; begin -- the first itemis not case -- sensitive; the second one -- is, and the compiler enforces it on -- the source code my_io_routine: My_IO_Routine; xyz_container: XYZ_Container; end My_Package; My_Package could of course be a parent to other packages, such as My_Package.Child_Package; We could then have dictionary My_Package.Child_Package is default upper; -- legal parameters for the default statement -- would be upper, lower, mixed, parent -- value parent means inherit -- value used by the parent package; -- it would not be allowed in dictionaries -- of packages that had no parents. -- compiler or editor/IDE enforces -- My_Package.MY_IDENTIFIER begin ubig: uBIG; usmall: uSMALL; end My_Package.Child_Package; This would be way of specifying coding standards that would be compiler-independent and editor/IDE independent and could be enforced by either. GNAT, which puts one package to a source file, could then have a .dic file to go with the .ads and .adb file for a package. Gnatstub could make a .dic file when it makes a .adb file. Gnatmake could force a recheck of source code if the .dic file changes. And so forth ... A future version of AdaGIDE could use the .dic file to drive automatic formatting, as could future versions of EMACS, vim or JED. (if the maintainers of those are sufficiently interested) Programmers could use their pet editors and still get the benefit of common standards, automatically enforced. Since this would have very little interaction with language standards, the dictionary language could be standardized independently of Ada itself.