comp.lang.ada
 help / color / mirror / Atom feed
* RE: Case dependence and coding standards
@ 2003-06-04 17:00 Lionel.DRAGHI
  0 siblings, 0 replies; 30+ messages in thread
From: Lionel.DRAGHI @ 2003-06-04 17:00 UTC (permalink / raw)
  To: comp.lang.ada



| -----Message d'origine-----
| De: Robert A Duff [mailto:bobduff@shell01.TheWorld.com]
...
| 
| It would be nicer to have a compiler that simply corrected such errors
| in the source file, instead of complaining about them.  The goal is to
| make consistent/readable code, not to punish programmers who are too
| lazy to hit the shift key.
With the ada-mode case exception file, they don't even need to hit the shift
key. 

They just need to hit some key on the first occurence of (for example) "IO",
and further Text_IO, Direct_IO and so on will be formated automaticaly.

-- 
Lionel Draghi



^ permalink raw reply	[flat|nested] 30+ messages in thread
* Case dependence and coding standards
@ 2003-06-03  5:05 Fionn mac Cuimhaill
  2003-06-03 17:31 ` Robert A Duff
  0 siblings, 1 reply; 30+ messages in thread
From: Fionn mac Cuimhaill @ 2003-06-03  5:05 UTC (permalink / raw)


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.



^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2003-06-10 15:05 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-04 17:00 Case dependence and coding standards Lionel.DRAGHI
  -- strict thread matches above, loose matches on Subject: below --
2003-06-03  5:05 Fionn mac Cuimhaill
2003-06-03 17:31 ` Robert A Duff
2003-06-03 17:46   ` Vinzent Hoefler
2003-06-03 19:04     ` Robert A Duff
2003-06-03 23:37       ` Randy Brukardt
2003-06-04  2:39         ` Wesley Groleau
2003-06-04 13:28           ` Georg Bauhaus
2003-06-04 15:44             ` Preben Randhol
2003-06-04 22:32             ` Wesley Groleau
2003-06-05 12:01               ` Georg Bauhaus
2003-06-05 15:36                 ` Preben Randhol
2003-06-05 17:41                   ` Wesley Groleau
2003-06-05 17:47                     ` Preben Randhol
2003-06-05 17:51                       ` Preben Randhol
2003-06-05 18:32                 ` Wesley Groleau
2003-06-06  8:58                   ` Georg Bauhaus
2003-06-07  0:53                     ` Wesley Groleau
2003-06-10 15:05                       ` Georg Bauhaus
2003-06-05 17:32               ` Wesley Groleau
2003-06-05 17:43                 ` Preben Randhol
2003-06-04  8:39       ` Vinzent Hoefler
2003-06-04 16:32         ` Stephen Leake
2003-06-05  1:27           ` Robert I. Eachus
2003-06-05  7:47           ` Vinzent Hoefler
2003-06-05 17:47             ` Stephen Leake
2003-06-05 19:43               ` Wesley Groleau
2003-06-06  9:27               ` Georg Bauhaus
2003-06-06 10:29                 ` Preben Randhol
2003-06-03 19:38   ` Stephen Leake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox