comp.lang.ada
 help / color / mirror / Atom feed
* signatures
@ 1988-12-07 16:36 Stephe Leake
  0 siblings, 0 replies; 6+ messages in thread
From: Stephe Leake @ 1988-12-07 16:36 UTC (permalink / raw)



I have noticed that several articles (mine among them) are being
posted without signatures. On my system (Suns with gnuemacs), it used
to be that my .signature file would automatically be appended when I
posted an article. Sometime in the recent past (I can't pinpoint it),
this feature disappeared, and apparently others have similar problems.

So check your system to see if it still works!

Stephe Leake 	(301) 975-3431 		leake@cme.nbs.gov
National Institute of Standards and Technology
(formerly National Bureau of Standards)
Rm. B-124, Bldg. 220
Gaithersburg, MD  20899

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

* signatures
@ 1999-07-29  0:00 Ehud Lamm
  1999-07-29  0:00 ` signatures Brian Rogoff
  0 siblings, 1 reply; 6+ messages in thread
From: Ehud Lamm @ 1999-07-29  0:00 UTC (permalink / raw)


Suppose I want to ensure that a to be written set of routines all
conform to a given signatre (let's say all sort routines have the
signature 
generic
   type item is private;
   type list is array(positive range <>) of item; 
procedure sort (s:in out list);
)?

What is the preffered way of doing this?

Ehud Lamm     mslamm@pluto.mscc.huji.ac.il
http://purl.oclc.org/NET/ehudlamm  <== My home on the web





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

* Re: signatures
  1999-07-29  0:00 signatures Ehud Lamm
@ 1999-07-29  0:00 ` Brian Rogoff
  1999-08-01  0:00   ` signatures Ehud Lamm
  0 siblings, 1 reply; 6+ messages in thread
From: Brian Rogoff @ 1999-07-29  0:00 UTC (permalink / raw)


On Thu, 29 Jul 1999, Ehud Lamm wrote:
> Suppose I want to ensure that a to be written set of routines all
> conform to a given signatre (let's say all sort routines have the
> signature 
> generic
>    type item is private;
>    type list is array(positive range <>) of item; 
> procedure sort (s:in out list);
> )?
> 
> What is the preffered way of doing this?

My preferred way would be

generic 
    type Item_Type is private;
    type List_Type is array(Positive range <>) of Item_Type;
    with procedure Sort(S : in out List_Type) is <>;
package Sort_Signature is end;

then instantiate this with some types and a sort procedure. You can use
this package as a package parameter to an implementation package like the 
following.

generic 
    with My_Sort is new Sort_Signature(<>);
package My_Package is 
... etc

A very nice addition to Ada over Ada-83, these package parameters and
signature packages!

-- Brian





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

* Re: signatures
  1999-07-29  0:00 ` signatures Brian Rogoff
@ 1999-08-01  0:00   ` Ehud Lamm
  1999-08-01  0:00     ` signatures James S. Rogers
  0 siblings, 1 reply; 6+ messages in thread
From: Ehud Lamm @ 1999-08-01  0:00 UTC (permalink / raw)


On Thu, 29 Jul 1999, Brian Rogoff wrote:

|My preferred way would be
|
|generic 
|  type Item_Type is private;
|  type List_Type is array(Positive range <>) of Item_Type;
|with procedure Sort(S : in out List_Type) is <>;
|package Sort_Signature is end;
|
|then instantiate this with some types and a sort procedure. 

Yes, this seems like the natural way. But I don't like the idea of coding
a sort routine, which may not be conforming, and only thn using it to
instantiate a package, just to ensure the signature conformance. Am I
missing something/is theere an easier way?


|You can use
|this package as a package parameter to an implementation package like the 
|following.
|
|generic 
|  with My_Sort is new Sort_Signature(<>);
|package My_Package is 
|... etc
|
|A very nice addition to Ada over Ada-83, these package parameters and
|signature packages!
|

Indeed, and you can also code a package to be an instantiation! Like this
(from GNAT):

with Ada.Numerics.Long_Complex_Types
with Ada.Numerics.Generic_Complex_Elementary_Functions

package Ada.Numerics.Long_Complex_Elementary_Functions is
 new Ada.Numerics.Generic_Complex_Elementary_Functions
                (Ada.Numerics.Long_Complex_Types)


Ehud Lamm     mslamm@pluto.mscc.huji.ac.il
http://purl.oclc.org/NET/ehudlamm  <== My home on the web







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

* Re: signatures
  1999-08-01  0:00     ` signatures James S. Rogers
@ 1999-08-01  0:00       ` Brian Rogoff
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Rogoff @ 1999-08-01  0:00 UTC (permalink / raw)


Well, they force your types to be tagged, and to inherit from the abstract 
tagged type on which your subprograms operate; this is something generic
signature packages don't do unless you want them to. 

If I had my druthers, the next version of Ada would have something like 
Java interfaces, GNU C++ signatures, or Sather types/abstract-classes, in 
addition to the module signatures Ada has now. This introduces even more 
structural subtyping into Ada, but who said life was simple? :-)

-- Brian

On Sun, 1 Aug 1999, James S. Rogers wrote:

> While on the subject of signatures, do not overlook abstract subprograms.
> Abstract subprograms strictly enforce a signature without enforcing any
> specific impelementation.
> 
> Jim Rogers
> Colorado Springs, Colorado
> 
> 
> 
> 





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

* Re: signatures
  1999-08-01  0:00   ` signatures Ehud Lamm
@ 1999-08-01  0:00     ` James S. Rogers
  1999-08-01  0:00       ` signatures Brian Rogoff
  0 siblings, 1 reply; 6+ messages in thread
From: James S. Rogers @ 1999-08-01  0:00 UTC (permalink / raw)


While on the subject of signatures, do not overlook abstract subprograms.
Abstract subprograms strictly enforce a signature without enforcing any
specific impelementation.

Jim Rogers
Colorado Springs, Colorado






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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-29  0:00 signatures Ehud Lamm
1999-07-29  0:00 ` signatures Brian Rogoff
1999-08-01  0:00   ` signatures Ehud Lamm
1999-08-01  0:00     ` signatures James S. Rogers
1999-08-01  0:00       ` signatures Brian Rogoff
  -- strict thread matches above, loose matches on Subject: below --
1988-12-07 16:36 signatures Stephe Leake

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