comp.lang.ada
 help / color / mirror / Atom feed
From: Mehdi Saada <00120260a@gmail.com>
Subject: no, it can't be, there's no "with procedure instance_of_generic_procedure is new generic_procedure;" ? Impossible !
Date: Sat, 7 Apr 2018 17:32:12 -0700 (PDT)
Date: 2018-04-07T17:32:12-07:00	[thread overview]
Message-ID: <115d2e72-2b30-4ec0-b42f-52e9df2905d4@googlegroups.com> (raw)

I just realized one can't do that:

generic
with procedure instance_of_generic_procedure is new generic_procedure;
...

The rules say (my compilator is in trouble, can't try):
formal_subprogram_declaration ::= formal_concrete_subprogram_declaration
    | formal_abstract_subprogram_declaration
formal_concrete_subprogram_declaration ::= 
     with subprogram_specification [is subprogram_default]
        [aspect_specification];
formal_abstract_subprogram_declaration ::= 
     with subprogram_specification is abstract [subprogram_default]
        [aspect_specification];
subprogram_default ::= default_name | <> | null
default_name ::= name

What ?? I have trouble figuring how it could have been forgotten. Any parenthood for instances of generic compilation units, packages or subprograms, should be possible to mention. For uniformity (or Heaven, no different)'s sake, also it would enable to check in particular things like:
generic
  type Item(<>);
  type Item_access is access Item;
  with procedure Free is new Unchecked_Deallocation (Item, Item_access);
package Smart_pointers ... Yes, I thought of that limitation with Jere's help with https://stackoverflow.com/questions/49660425/ada-difficulties-with-generics-incomplete-types-and-self-referencing-structure .

I hope I wasn't gravely mistaken, or else I'll probably never come here again because of shame...


             reply	other threads:[~2018-04-08  0:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-08  0:32 Mehdi Saada [this message]
2018-04-08  6:50 ` no, it can't be, there's no "with procedure instance_of_generic_procedure is new generic_procedure;" ? Impossible ! J-P. Rosen
2018-04-09 23:43   ` Shark8
2018-04-08 11:15 ` Mehdi Saada
2018-04-08 11:46   ` Jere
2018-04-08 13:47     ` Mehdi Saada
2018-04-12  8:56 ` Marius Amado-Alves
2018-04-12 10:14   ` Mehdi Saada
2018-04-13  0:37     ` Shark8
2018-04-13 12:34       ` Mehdi Saada
2018-04-13 15:57         ` Mehdi Saada
2018-04-13 23:59           ` Randy Brukardt
2018-04-14  0:00         ` Randy Brukardt
2018-04-14  6:00           ` Mehdi Saada
replies disabled

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