-
Notifications
You must be signed in to change notification settings - Fork 182
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
Minor update pure/elemental
in string_type
module
#562
Conversation
I also think both of these are safe to be Others are cosmetic and straightforward, so I think this PR can go forward. |
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!
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.
There are some limitations in char_string
and char_string_range
which lead me to use pure
rather than elemental
. Namely, there is an issue with elemental
which can result in an uncatchable runtime error. While useful, the subtle consequences of elemental
usage might lead to hard to debug runtime errors for some use cases.
Add test for `elemental` `move`.
Thanks @awvwgk , I understand what you mean now. |
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, looks good to me.
pure elemental -> elemental
: ✔string_type
procedurenew_string
new_string_from_integer
new_string_from_logical
pure -> elemental
: ❓(Update: ❌)interfacechar
procedurechar_string
char_string_range
private functionmaybe
elemental
: ❓(Update: ✔)move
proceduremove_string_string
pure
: ✔move
proceduremove_char_string
move_char_string
move_char_char
Description
Here I have updated the elemental attributes of the routine. There are two areas that are doubtful ❓, but I think they can be
elemental
.Another proposal
There is another issue.
string_type
interface relies on theto_string
routine, it can convertcharacter
,integer
, andlogical
variables into strings and be elemental becausetype(string_type)
can be non-allocatable, but it does not support theformat
argument.While
to_string
supportsinteger
,real
,complex
andlogical
types, supportformat
argument, but not elemental.string_type
seems to have a elemental advantage to construct strings. It seems that we can take advantage of this and letstring_type
add support forreal
andcomplex
types, and support theformat
argument?