comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: subprogram must not be deeper than access type
Date: Tue, 4 Oct 2011 09:58:21 +0200
Date: 2011-10-04T09:58:21+02:00	[thread overview]
Message-ID: <gk6gupu4gbie.1feok3e8ay6ot$.dlg@40tude.net> (raw)
In-Reply-To: op.v2s7xnseule2fv@index.ici

On Tue, 04 Oct 2011 06:26:01 +0200, Yannick Duchêne (Hibou57) wrote:

> Le Tue, 27 Sep 2011 09:52:09 +0200, Dmitry A. Kazakov  
> <mailbox@dmitry-kazakov.de> a écrit:
>> Compare it with declare-begin-end blocks they too have no names and have no
>> identifiable counterpart in the domain, just an implementation detail.
> Except these are just flowed. If you want a block to be possibly invoked  
> independently, then you make it a procedure, … which is named.

There is no clear margin, but the name of a procedure may refer to its name
and/or its singleton type. They are not separated properly, because Ada has
no procedural types.

BTW, blocks can be named in Ada:

A : begin
      null;
   end A;

Here A is the proper name, and you don't need the type of A. This type is
anonymous.

> If you do not need to access sub‑records of a record,

Access to the subrecord is needed, but only though its components not as a
whole. These components would be named but have anonymous types.

------------------------------
BTW, the list of parameters of a subprogram is an anonymous record type,
but Ada does not require its explicit declaration, e.g.

   type Integer_Tuple is record
      Left : Integer;
      Right : Integer;
   end record;
   function "+" : Integer_Tuple return Integer;

If it could, you would have so much longed variant arguments:

   type Printf_Arguments (Some_Discriminant : ...) is record
      case Some_Discriminant is
          when ... =>
          when ... =>
          ...
      end case;
   end record;
   pragma Unchecked_Union (Printf_Arguments);
   procedure Printf : Printf_Arguments;

(:-))

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2011-10-04  7:58 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-25  9:02 subprogram must not be deeper than access type Natasha Kerensikova
2011-09-25 14:04 ` Oliver Kleinke
2011-09-26  9:35   ` Natasha Kerensikova
2011-10-03 23:30   ` Yannick Duchêne (Hibou57)
2011-10-03 23:39     ` Adam Beneschan
2011-10-04  0:52       ` Yannick Duchêne (Hibou57)
2011-10-04  1:48         ` Yannick Duchêne (Hibou57)
2011-09-25 14:23 ` Robert A Duff
2011-09-25 15:03 ` georg bauhaus
2011-09-26  9:45   ` Natasha Kerensikova
2011-09-26 13:43     ` Robert A Duff
2011-09-26 14:20       ` Dmitry A. Kazakov
2011-09-26 16:15         ` Robert A Duff
2011-09-26 19:30           ` Dmitry A. Kazakov
2011-09-27  0:41             ` Robert A Duff
2011-09-27  8:58               ` Dmitry A. Kazakov
2011-10-04  4:19               ` Yannick Duchêne (Hibou57)
2011-09-27  5:50             ` J-P. Rosen
2011-09-27  7:52               ` Dmitry A. Kazakov
2011-10-04  4:26                 ` Yannick Duchêne (Hibou57)
2011-10-04  7:58                   ` Dmitry A. Kazakov [this message]
2011-10-04 15:10                     ` Georg Bauhaus
2011-10-04 15:34                       ` Dmitry A. Kazakov
2011-10-04 15:49                         ` Yannick Duchêne (Hibou57)
2011-10-04 16:04                           ` Dmitry A. Kazakov
2011-10-04 15:44                       ` Yannick Duchêne (Hibou57)
2011-10-04 16:05                         ` Georg Bauhaus
2011-10-04 16:47                           ` Yannick Duchêne (Hibou57)
2011-10-04 15:41                     ` Yannick Duchêne (Hibou57)
2011-09-26 18:59       ` Jeffrey Carter
2011-09-27  0:35         ` Robert A Duff
2011-10-04  4:30         ` Yannick Duchêne (Hibou57)
2011-10-04 18:40           ` Jeffrey Carter
2011-09-26 14:29     ` Georg Bauhaus
2011-09-26 15:31       ` Georg Bauhaus
2011-10-04  4:35       ` Yannick Duchêne (Hibou57)
2011-10-04  4:13     ` Yannick Duchêne (Hibou57)
2011-09-25 17:16 ` Jeffrey Carter
2011-09-25 21:53   ` Robert A Duff
2011-09-26  9:25     ` Georg Bauhaus
2011-09-26 23:00     ` Randy Brukardt
2011-09-27  0:34       ` Robert A Duff
replies disabled

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