:: Re: [DNG] Ada strings
Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Didier Kryn
Ημερομηνία:  
Προς: dng
Αντικείμενο: Re: [DNG] Ada strings
Le 07/10/2024 à 11:15, Kevin Chadwick via Dng a écrit :
> On a side note if you look at the adacore info on packages then I
> personally prefer not to use use clauses when withing (#include but
> better) non nested packages myself. More verbose and longer lines but
> provides for some nice dot notation. AdaCore disagree so it isn't always
> clear which functions/procedures are being called from which packages
> in their examples especially when new. I might open an issue on their
> learn github.



    When there is an ambiguity about subprogram or variable, because of
multiple "use", the compiler complains and yo are forced to write the
whole name. You can always use the whole name anyway.

    There is another convenient namespace instruction: "renames"

eg:

    package Tio renames Ada.Text_Io;
...
    Tio.Put_Line( "Hello Workd!" );

   You can rename subprograms in the same way.

--     Didier