-
Notifications
You must be signed in to change notification settings - Fork 186
Added to_lower, to_upper, reverse and to_title function to stdlib_string_type.f90 file #346
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
Conversation
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.
Thanks for sharing. I suggest to rename the imports from stdlib_ascii
to avoid polluting the namespace of stdlib_string_type
and reexporting them accidentally.
I recommend to use the maybe()
wrapper for safe memory access inside stdlib_string_type
rather than directly accessing the raw value on the right-hand-side.
Note: here how using maybe(string) automatically access the string%raw. maybe is used for safe memory access. Co-authored-by: Sebastian Ehlert <[email protected]>
Elemental should be the way to go here. For Also, the manual Makefile failure is related to the newly introduced dependency of stdlib_string_type.o: stdlib_ascii.o to |
This comment has been minimized.
This comment has been minimized.
Can I create a new .f90 file in the |
You can add a new file, but make sure to register the unit test in the CMake build file in the same directory than as well. |
What happens when a user gives a |
…ed typo in README.md
… of stdlib_string_type module
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.
Looks good to me, thanks @aman-godara!
Assigning |
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.
@aman-godara Can you add the new procedures to the specification of the string_type
in doc/specs/stdlib_string_type.md
as well?
@awvwgk Yes, I am working on documenting the functions created. I just needed a little help with #346 (comment) to proceed further because I am at the starting stage of learning CMake. @milancurcic yes, you got it right. I wanted to talk more about |
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.
Thanks, this looks good now.
With two approvals, I will merge. Thank you, @aman-godara! |
@awvwgk does |
Indeed, it does make sure that an unallocated stdlib/src/stdlib_string_type.f90 Lines 1166 to 1177 in bc37bcc
|
May I ask why we didn't design the constructor to have an empty character sequence ("") in stdlib/src/stdlib_string_type.f90 Lines 346 to 352 in bc37bcc
|
There is still the possibility to have an uninitialized use stdlib_string_type
implicit none
type(string_type) :: str
print *, str
end |
Got it! 👍 Thanks! |
Status: open for review.
Implemented: the functions asked in #335, added unit tests for each of these functions in
test_string_functions.f90
file and documented the functions instdlib_string_type.md
file. (Fixes #335)Yet to be done in this pull request: #346 (comment) (done in the pull request #356)
Note: Please have a look at the recent suggestion comment concerning
to_title
functionI am still trying to get the issues concerning my compiler fixed to run the code on my machine. The code written is not checked to run successfully on machine yet. Thus, I kindly request the reviewers to please also run the code once.