-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide abstract base class for a string object #333
Conversation
- provide full compatibility with the string_type - provide overloaded interfaces in the base class to define all character intrinsic functions for both character scalars and functional strings - add preliminary specs on the public API (not developer API) of the abstract base class - add tests to check a minimal implementation of a string class
Does this add functionality relative to the |
As with the |
Okay, thanks. I think it warrants a broader discussion then. Should stdlib offer:
My current opinion is that we should aim to minimize overlapping functionality. So, is a |
I'm going to mark this patch as |
Since I'm not planning to continue working on this, I'm going to close this PR. This patch can be resurrected from d3752b0 if needed. |
This patch implements an abstract base class (ABC) for an extendible string class (not to be confused with the non-extendible string type). The implementation also shows the full insanity of object oriented string handling in Fortran required to just support the intrinsic functionality and sheds some light on the current state of compilers implementing class inheritance.
Goals of this PR
string_type
Design strategy
string_type
as return value rather than returning polymorphic string objectsstdlib_string_class
defines and exports overloaded interfaces for the ABC, which should be reexported in implementations to provide intrinsic functionality (still requires explicit import)string_class
can be created by assignment from character values, string types or string objectsAdditional resources
I prepared the
stdlib_string_class
module in awvwgk/stdlib_string as fpm project. The specs are available at https://awvwgk.github.io/stdlib_string. The projects also includes a version of ftlString and StringiFor based on thestring_class
proposed here.