AdaCore / gnatcoll-core

GNAT Components Collection – Core packages
Other
44 stars 29 forks source link

Inconsistent declarations #75

Open pjljvandelaar opened 1 year ago

pjljvandelaar commented 1 year ago

Hi Gnatcoll developers,

As you can see e.g. in https://github.com/AdaCore/gnatcoll-core/blob/12821a4c8a6d1a3f6b7f34a6a6d72e58b4d88e10/src/gnatcoll-boyer_moore.adb#L136-L138 some declarations are combined, while others are kept apart.

Do you want to be consistent in this aspect? So either

 Prefix          : Offset_Array (1 .. From_String'Length); 
 Reverse_Prefix  : Offset_Array (1 .. From_String'Length); 
 K               : Natural := 0; 
 K2              : Natural := 0; 

or

 Prefix, Reverse_Prefix  : Offset_Array (1 .. From_String'Length); 
 K, K2                   : Natural := 0; 

If so, using the rejuvenation library we can rewrite the code to the desired format.

Greetings, Pierre

Problem detected and solvable using Rejuvenation-Ada crate vote for Rejuvenation-Ada as The 2022 Ada Crate Of The Year

Jicquel commented 6 months ago

Hello pjljvandelaar, thank you for opening this issue. You can open a PR with the modification you suggested, and I will take care of it. I would prefer for the more compact version, so the second one in your example. Please be aware that we would like to keep our current coding style, as already discussed in the other PR you opened.