comp.lang.ada
 help / color / mirror / Atom feed
* RE: Suggestion for Ada 200x - Interface inheritance
@ 2003-06-03 17:38 Lionel.DRAGHI
  2003-06-03 17:47 ` Preben Randhol
  2003-06-03 17:48 ` Vinzent Hoefler
  0 siblings, 2 replies; 47+ messages in thread
From: Lionel.DRAGHI @ 2003-06-03 17:38 UTC (permalink / raw)
  To: comp.lang.ada



| -----Message d'origine-----
| De: Pascal Obry [mailto:p.obry@wanadoo.fr]
...
| 
| > My idea was to introduce "<=" for out parameters and "<=>" 
| for in out.
| > 
| > Example:
| > Create (File   <=> My_File,
| >         Mode    => In_File,
| >         Name    => "My_File",
| >         Status <=  Status);
| > Pretty clear, isn't it? :-) And could also apply to declaration!
| 
| And this was part of the green language. I think it was := 
| :=: =: for "in" "in
| out" and "out" mode.

I didn't know, but i really prefer "arrows".
It's much more clear, almost as a sequence diagram within the code! :-)

-- 
Lionel Draghi 



^ permalink raw reply	[flat|nested] 47+ messages in thread
* RE: Suggestion for Ada 200x - Interface inheritance
@ 2003-06-04 16:22 Lionel.DRAGHI
  0 siblings, 0 replies; 47+ messages in thread
From: Lionel.DRAGHI @ 2003-06-04 16:22 UTC (permalink / raw)
  To: comp.lang.ada



| -----Message d'origine-----
| De: Vinzent Hoefler [mailto:ada.rocks@jlfencey.com]
...
| 
| So what about '<-', '<->' and '->' then? If I am right, these are
| still free. Perhaps a little C'ish, especially the last. ;-)
| 
Wonderful, let's go for it! :-)



^ permalink raw reply	[flat|nested] 47+ messages in thread
* RE: Suggestion for Ada 200x - Interface inheritance
@ 2003-06-03 17:33 Lionel.DRAGHI
  2003-06-03 17:46 ` Vinzent Hoefler
  0 siblings, 1 reply; 47+ messages in thread
From: Lionel.DRAGHI @ 2003-06-03 17:33 UTC (permalink / raw)
  To: comp.lang.ada



| -----Message d'origine-----
| De: Bill Findlay [mailto:yaldnifw@blueyonder.co.uk]
...
| > 
| > Example:
| > Create (File <=> My_File,
| >       Mode    => In_File,
| >       Name    => "My_File",
| >       Status <=  Status);
| > Pretty clear, isn't it? :-) And could also apply to declaration!
| 
| I hope Status is not of Boolean type! 8-)

No, it isn't. I had called it Is_Created.



^ permalink raw reply	[flat|nested] 47+ messages in thread
* RE: Suggestion for Ada 200x - Interface inheritance
@ 2003-06-02 15:57 Lionel.DRAGHI
  2003-06-02 18:58 ` Pascal Obry
  2003-06-02 19:27 ` Bill Findlay
  0 siblings, 2 replies; 47+ messages in thread
From: Lionel.DRAGHI @ 2003-06-02 15:57 UTC (permalink / raw)
  To: comp.lang.ada



| -----Message d'origine-----
| De: Steve [mailto:nospam_steved94@attbi.com]
...
| What do you think of the idea of also optionally giving the 
| mode of the
| parameter, which if present must match the function or procedure
| declaration.  That is, extending the above example:
| 
|   result := Add( in left => 2, in right => 3 );
| 
| Why?  Readability.  When reading code it is sometimes unclear from the
| caller whether or not a procedure modifies its parameters. 
 
Yes, and i often need to "navigate" up to the operation declaration to see
parameter's mode.

My idea was to introduce "<=" for out parameters and "<=>" for in out.

Example:
Create (File   <=> My_File,
        Mode    => In_File,
        Name    => "My_File",
        Status <=  Status);
Pretty clear, isn't it? :-) And could also apply to declaration!

Anyway, some ada-mode colouring parameters according to their mode would do
the job just fine for me.

-- 
Lionel Draghi



^ permalink raw reply	[flat|nested] 47+ messages in thread
* Suggestion for Ada 200x - Interface inheritance
@ 2003-05-23 23:05 Steve
  2003-05-24  1:02 ` Robert A Duff
  2003-05-24 12:35 ` Wojtek Narczynski
  0 siblings, 2 replies; 47+ messages in thread
From: Steve @ 2003-05-23 23:05 UTC (permalink / raw)


Java and C# use the concept of interface inheritance.  What do you think of
adding this feature to Ada?

A tagged type containing only abstract methods (functions and procedures)
would be considered to be an interface.  Any tagged type may be dervied from
at most one tagged type containing data elements and any number of
interfaces.

That is, you may define an interface:

  type interface_example is abstract tagged null record;

  function in_order( obj : interface_example ) return boolean;

  procedure swap( obj1, obj2 : in out interface_example );

  type data_value is tagged
    record
      field1 : Natural;
      field2 : Natural;
    end record;

  type sorted_data is new data_value, interface_example with
    record
      is_valid : Boolean;
    end record;

The objective is to add interfaces to existing objects such that they may be
used by common routines, in the same way as Java.  In fact this might make
it easier to interface with Java.

Steve
(The Duck)





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

end of thread, other threads:[~2003-06-04 16:22 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-03 17:38 Suggestion for Ada 200x - Interface inheritance Lionel.DRAGHI
2003-06-03 17:47 ` Preben Randhol
2003-06-03 17:48 ` Vinzent Hoefler
  -- strict thread matches above, loose matches on Subject: below --
2003-06-04 16:22 Lionel.DRAGHI
2003-06-03 17:33 Lionel.DRAGHI
2003-06-03 17:46 ` Vinzent Hoefler
2003-06-03 18:49   ` Bill Findlay
2003-06-03 19:02     ` Vinzent Hoefler
2003-06-03 19:13     ` Vinzent Hoefler
2003-06-02 15:57 Lionel.DRAGHI
2003-06-02 18:58 ` Pascal Obry
2003-06-02 19:27 ` Bill Findlay
2003-05-23 23:05 Steve
2003-05-24  1:02 ` Robert A Duff
2003-05-29 16:47   ` Brian Gaffney
2003-06-01 10:29   ` Craig Carey
2003-05-24 12:35 ` Wojtek Narczynski
2003-05-24 17:53   ` Georg Bauhaus
2003-05-25 13:11     ` Wojtek Narczynski
2003-05-24 22:07   ` Robert A Duff
2003-05-25 14:12     ` Wojtek Narczynski
2003-05-25 17:53       ` Jeffrey Carter
2003-05-25 18:47         ` Wesley Groleau
2003-05-25 19:42           ` Hyman Rosen
2003-05-26  7:53             ` Wojtek Narczynski
2003-05-26 15:50               ` Hyman Rosen
2003-05-27 18:41                 ` Wojtek Narczynski
2003-05-27 18:55                   ` Wesley Groleau
2003-05-27 19:13                   ` Hyman Rosen
2003-05-28 13:07                     ` Wojtek Narczynski
2003-05-28 13:28                       ` Jean-Pierre Rosen
2003-05-29  0:58                       ` Hyman Rosen
2003-05-28 22:13             ` Robert A Duff
2003-05-28 23:50               ` Hyman Rosen
2003-05-29  9:17               ` Dmitry A. Kazakov
2003-05-29 13:31               ` Wojtek Narczynski
2003-05-26  7:51           ` Wojtek Narczynski
2003-05-25  1:33   ` Steve
2003-05-25 10:37     ` Simon Wright
2003-05-26  7:54     ` Jean-Pierre Rosen
2003-05-26 10:07       ` Preben Randhol
2003-05-26 16:32         ` Pascal Obry
2003-05-26 16:59           ` Preben Randhol
2003-06-01 10:53       ` Craig Carey
2003-06-01 12:17         ` Preben Randhol
2003-05-26  7:49   ` Jean-Pierre Rosen
2003-06-02  9:01     ` Wojtek Narczynski

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