comp.lang.ada
 help / color / mirror / Atom feed
* Actual  Ada style: type names and unary +
@ 1998-01-18  0:00 Tom Moran
  1998-01-18  0:00 ` Tom Moran
  1998-01-18  0:00 ` Robert Dewar
  0 siblings, 2 replies; 4+ messages in thread
From: Tom Moran @ 1998-01-18  0:00 UTC (permalink / raw)



To get an idea of the style of Ada "as she is spoke", I ran a simple
scanner on some of the "software components" source files in the
November 1997 Walnut Creek Ada CD (disk 1) looking for the unary +
operator and type/subtype identifiers ending in _t, _type, or 's'
(but excluding "access", "address", "class", and "status").  It
found no instances of unary plus or "_t", nearly 50% use of _type,
and about 20% use of (possible) plurals.  As a check, I scanned the
adainclude directory of Gnat 3.10p1-nt (551 files) and found 3
instances of unary + (all numeric), and almost 1% use of _t.

192 files in 7 .zips in 11/97 Walnut Creek Ada CD 1, ADA\SWCOMPS,
selected randomly as the largish zips
   0 unary +
 377 type declarations
 176 _type (in 44/192 files)
   0 _t
  72 possible plurals as type names (in 25/192 files)

The scanner is available if someone would like to scan a larger or
more diverse body of code.  No warranties, of course.





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

* Re: Actual Ada style: type names and unary +
  1998-01-18  0:00 Actual Ada style: type names and unary + Tom Moran
  1998-01-18  0:00 ` Tom Moran
@ 1998-01-18  0:00 ` Robert Dewar
  1 sibling, 0 replies; 4+ messages in thread
From: Robert Dewar @ 1998-01-18  0:00 UTC (permalink / raw)



Tom Moran says

<<To get an idea of the style of Ada "as she is spoke", I ran a simple
scanner on some of the "software components" source files in the
November 1997 Walnut Creek Ada CD (disk 1) looking for the unary +
operator and type/subtype identifiers ending in _t, _type, or 's'
(but excluding "access", "address", "class", and "status").  It
found no instances of unary plus or "_t", nearly 50% use of _type,
and about 20% use of (possible) plurals.  As a check, I scanned the
adainclude directory of Gnat 3.10p1-nt (551 files) and found 3
instances of unary + (all numeric), and almost 1% use of _t.
>>


Your scanner is broken, here are some definitions of unary + from adainclude

[723]   function "+" (Str : VString_Var)  return Pattern;
[728]   function "+" (Str : VString_Func) return Pattern;
[733]   function "+" (P : Pattern_Var)    return Pattern;
[738]   function "+" (P : Boolean_Func)   return Pattern;

These are actually good examples of what I was talking about. From a
conceptual point of view a string variable should be able to be used as
a pattern, but we need a definite action to achieve this.





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

* Re: Actual  Ada style: type names and unary +
  1998-01-18  0:00 Actual Ada style: type names and unary + Tom Moran
@ 1998-01-18  0:00 ` Tom Moran
  1998-01-22  0:00   ` Mats Weber
  1998-01-18  0:00 ` Robert Dewar
  1 sibling, 1 reply; 4+ messages in thread
From: Tom Moran @ 1998-01-18  0:00 UTC (permalink / raw)



Robert Dewar says
>Your scanner is broken, here are some definitions of unary + from adainclude
and gives examples of function "+" ... declarations.
  I should have been clearer.  My scanner was looking for USES, not
DECLARATIONS of unary plus and it found 3 - all numeric.  The Gnat
adainclude is, of course, more likely to have declarations than uses
so it is not a complete test case.  The files I checked on the Ada
CDROM are a better corpus for that - they had zero uses of unary plus.
  The scanner's current definition of a use of a unary plus is a + not
in the last column and  preceded (ignoring white space) by one of "(",
",", or "=" on the same line. Then I look manually to eliminate
multi-line arithmetic expressions.  If someone with a true Ada parser
would do a fuller study of a large, diverse body of existing Ada
source code, it would be a contribution to knowledge and an aid in
stepping beyond theological argument, IMHO.





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

* Re: Actual  Ada style: type names and unary +
  1998-01-18  0:00 ` Tom Moran
@ 1998-01-22  0:00   ` Mats Weber
  0 siblings, 0 replies; 4+ messages in thread
From: Mats Weber @ 1998-01-22  0:00 UTC (permalink / raw)



> If someone with a true Ada parser
> would do a fuller study of a large, diverse body of existing Ada
> source code, it would be a contribution to knowledge and an aid in
> stepping beyond theological argument, IMHO.

There is an Ada lexical analyzer in the code I just posted under the subject:
RTF_Ada_File utility (but it is very slow). There also is one in the GNAT
sources, of course.




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

end of thread, other threads:[~1998-01-22  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-18  0:00 Actual Ada style: type names and unary + Tom Moran
1998-01-18  0:00 ` Tom Moran
1998-01-22  0:00   ` Mats Weber
1998-01-18  0:00 ` Robert Dewar

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