comp.lang.ada
 help / color / mirror / Atom feed
* GNAT naming convention for seperate?
@ 2001-06-08 16:52 Harry E. Tucker
  2001-06-09  6:36 ` Simon Wright
  2001-06-09 11:16 ` David C. Hoos, Sr.
  0 siblings, 2 replies; 5+ messages in thread
From: Harry E. Tucker @ 2001-06-08 16:52 UTC (permalink / raw)


Hi,

What is the naming convention for seperate procedures? Yes, I'm being
lazy here. I've looked around the docs and just can't find a reference.

Harry



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

* Re: GNAT naming convention for seperate?
  2001-06-08 16:52 GNAT naming convention for seperate? Harry E. Tucker
@ 2001-06-09  6:36 ` Simon Wright
  2001-06-09 11:16 ` David C. Hoos, Sr.
  1 sibling, 0 replies; 5+ messages in thread
From: Simon Wright @ 2001-06-09  6:36 UTC (permalink / raw)


"Harry E. Tucker" <snagaghash@sonetcom.com> writes:

> Hi,
> 
> What is the naming convention for seperate procedures? Yes, I'm being
> lazy here. I've looked around the docs and just can't find a reference.

If you have

  separate (Foo.Bar)
  procedure P is ....

it needs to be in file

  foo-bar-p.adb

(you could of course always have run gnatchop on the source file to
get the answer!)

Or perhaps -- what _do_ you mean by "naming convention for seperate
procedures"? (NB spelling of "sepArate")



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

* Re: GNAT naming convention for seperate?
  2001-06-08 16:52 GNAT naming convention for seperate? Harry E. Tucker
  2001-06-09  6:36 ` Simon Wright
@ 2001-06-09 11:16 ` David C. Hoos, Sr.
  2001-06-23 11:30   ` Carbonne Damien
  1 sibling, 1 reply; 5+ messages in thread
From: David C. Hoos, Sr. @ 2001-06-09 11:16 UTC (permalink / raw)


The naming convention for separates is the same as the naming
convention for any unit.

The rule is that any dot (.) in the unit name is replaced by a
dash (-) in the filename, and that all letters in the filename are
lower case.

Further, the filename extensions are .ads for specifications,
and .adb for bodies.

"Harry E. Tucker" <snagaghash@sonetcom.com> wrote in message
news:3B2102E9.729F3F9@sonetcom.com...
> Hi,
>
> What is the naming convention for seperate procedures? Yes, I'm being
> lazy here. I've looked around the docs and just can't find a reference.
>
> Harry



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



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

* Re: GNAT naming convention for seperate?
  2001-06-09 11:16 ` David C. Hoos, Sr.
@ 2001-06-23 11:30   ` Carbonne Damien
  2001-06-23 14:29     ` David C. Hoos, Sr.
  0 siblings, 1 reply; 5+ messages in thread
From: Carbonne Damien @ 2001-06-23 11:30 UTC (permalink / raw)


"David C. Hoos, Sr." a �crit :

> The naming convention for separates is the same as the naming
> convention for any unit.
>
> The rule is that any dot (.) in the unit name is replaced by a
> dash (-) in the filename, and that all letters in the filename are
> lower case.

GNAT documentation 3.13p (File Naming Rule) says:
-------------------------------------------
The default file name is determined by the name of the unit that the file
contains. The name is formed by taking the full expanded name of the unit and
replacing the separating dots with
hyphens and using lowercase for all letters.

An exception arises if the file name generated by the above rules starts with
one of the characters a,g,i, or s, and the second character is a minus. In this
case, the character tilde is used in
place of the minus. The reason for this special rule is to avoid clashes with
the standard names for child units of the packages System, Ada, Interfaces, and
GNAT, which use the prefixes
s- a- i- and g- respectively.

The file extension is `.ads' for a spec and `.adb' for a body. The following
list shows some examples of these rules.

`main.ads'
     Main (spec)
`main.adb'
     Main (body)
`arith_functions.ads'
     Arith_Functions (package spec)
`arith_functions.adb'
     Arith_Functions (package body)
`func-spec.ads'
     Func.Spec (child package spec)
`func-spec.adb'
     Func.Spec (child package body)
`main-sub.adb'
     Sub (subunit of Main)
`a~bad.adb'
     A.Bad (child package body)
-------------------------------------------
So there are cases where '.' is replaced by '~'

Damien




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

* Re: GNAT naming convention for seperate?
  2001-06-23 11:30   ` Carbonne Damien
@ 2001-06-23 14:29     ` David C. Hoos, Sr.
  0 siblings, 0 replies; 5+ messages in thread
From: David C. Hoos, Sr. @ 2001-06-23 14:29 UTC (permalink / raw)
  To: comp.lang.ada

You are quite correct.  I had quoted the rule from memory, rather than
looking it up.  In my mind, I had precluded the possibility of ever
needing the special rule, because I would never name a unit with the
initial identifier having only one character in its name -- i.e., a name
like 'A' is not sufficiently descriptive to use.

----- Original Message -----
From: "Carbonne Damien" <damien.carbonne@free.fr>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: June 23, 2001 6:30 AM
Subject: Re: GNAT naming convention for seperate?


> "David C. Hoos, Sr." a �crit :
>
> > The naming convention for separates is the same as the naming
> > convention for any unit.
> >
> > The rule is that any dot (.) in the unit name is replaced by a
> > dash (-) in the filename, and that all letters in the filename are
> > lower case.
>
> GNAT documentation 3.13p (File Naming Rule) says:
> -------------------------------------------
> The default file name is determined by the name of the unit that the file
> contains. The name is formed by taking the full expanded name of the unit
and
> replacing the separating dots with
> hyphens and using lowercase for all letters.
>
> An exception arises if the file name generated by the above rules starts
with
> one of the characters a,g,i, or s, and the second character is a minus. In
this
> case, the character tilde is used in
> place of the minus. The reason for this special rule is to avoid clashes
with
> the standard names for child units of the packages System, Ada, Interfaces,
and
> GNAT, which use the prefixes
> s- a- i- and g- respectively.
>
> The file extension is `.ads' for a spec and `.adb' for a body. The following
> list shows some examples of these rules.
>
> `main.ads'
>      Main (spec)
> `main.adb'
>      Main (body)
> `arith_functions.ads'
>      Arith_Functions (package spec)
> `arith_functions.adb'
>      Arith_Functions (package body)
> `func-spec.ads'
>      Func.Spec (child package spec)
> `func-spec.adb'
>      Func.Spec (child package body)
> `main-sub.adb'
>      Sub (subunit of Main)
> `a~bad.adb'
>      A.Bad (child package body)
> -------------------------------------------
> So there are cases where '.' is replaced by '~'
>
> Damien
>
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>




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

end of thread, other threads:[~2001-06-23 14:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-08 16:52 GNAT naming convention for seperate? Harry E. Tucker
2001-06-09  6:36 ` Simon Wright
2001-06-09 11:16 ` David C. Hoos, Sr.
2001-06-23 11:30   ` Carbonne Damien
2001-06-23 14:29     ` David C. Hoos, Sr.

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