-
Notifications
You must be signed in to change notification settings - Fork 190
Hashap key generic interfaces #827
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Included tests in test_maps.fypp for generic key interfaces.
Removed un-needed import statements that were causing compile issues with some compilers.
Updated specs and examples to include generic key interface examples.
I believe this is ready for review. There was a single CI failure that I don't understand, but doesn't appear to be related to the code updates? |
Also worth mentioning that some of the hashmap examples were somewhat outdated, assuming the hashmap capabilities have matured since the examples were written. In one example there was a routine written, key_to_char, to convert a key back to a character string. Since the get function does this exact task, the example was updated to use the get function instead of using a custom function. |
Is this PR related to #664 ? (I don't think so, but just to be sure). |
They are unrelated. This PR only affects the 'key' field. No changes to 'other'. |
Minor reordering of code to make more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @chuckyvt . Overall LGTM. IMO it could be merged, pending minor changes.
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
Renaming of char_type variable as _type is typical reserved for derived types.
Thanks for the detailed review. I believe all requested changes have been included. |
@chuckyvt : Could you rebase this PR, please (to check if it solves the CI issue)? |
Thank you @chuckyvt . I will wait a couple of days before merging, in case of additional comments. |
This is update to the hashmap capabilities to include generic key interfaces for most of the type-bound procedures that use key type. I believe this will be a nice step forward for the user interface, reducing number of lines of code to use the hashamaps, and makes it closer to the style of a dictionary in Python.
For example, currently to map an entry:
This simplifies to
call map % map_entry( [1], other, conflict )
This is the initial submit with src and testing updated for review. Will work on specs and adding examples next.