comp.lang.ada
 help / color / mirror / Atom feed
* no, it can't be, there's no "with procedure instance_of_generic_procedure is new generic_procedure;" ? Impossible !
@ 2018-04-08  0:32 Mehdi Saada
  2018-04-08  6:50 ` J-P. Rosen
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Mehdi Saada @ 2018-04-08  0:32 UTC (permalink / 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...


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

end of thread, other threads:[~2018-04-14  6:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-08  0:32 no, it can't be, there's no "with procedure instance_of_generic_procedure is new generic_procedure;" ? Impossible ! Mehdi Saada
2018-04-08  6:50 ` 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

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