-
Notifications
You must be signed in to change notification settings - Fork 23
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
README: update examples #32
Conversation
@band-a-prend Thanks! |
I hope I don't misunderstood the documentation in stringifor_string _t.F90 (line 1297)
and actual result is presented in this patch while at line 1307 test is !< test_passed(1) = (astring%join(array=strings)//''==strings(1)//strings(2)//strings(3)) |
@band-a-prend I do not see the problem, can you give me more details? Cheers |
Sorry for delay with answer. I need to recheck some things. Yes. The test is ok as in the mentioned documentation the But now I'm confused with documentation example: StringiFor/src/lib/stringifor_string_t.F90 Line 1308 in 9c47122
StringiFor/src/lib/stringifor_string_t.F90 Lines 1297 to 1298 in 9c47122
But it seems that if program string_join
use stringifor
type(string) :: astring
type(string) :: strings(3)
astring = 'Hello World'
strings(1) = 'one'
strings(2) = 'two'
strings(3) = 'three'
print "(A)", astring%join(strings, sep='-')//'' ! print "one-two-three"
print "(A)", "one-two-three: "//astring%chars()
end program string_join Output:
|
Thank you very much for the clarification, I'll re-check this soon, later today. |
I tried to re-read carefully the doc and the tests. For me the documentation of method is incomplete or obscure, but not wrong (or if it is wrong the error is due to my bad English), in particular, when I defined the method, my intentions were:
As a consequence, your deduction that
is correct for me, if sep is passed it is used independently to the value of self. Probably I have to correct my bad English into the documentation of the method, if you have any suggestion it is more than welcome. Cheers |
I mean that I was confused by implementation: i.e. that for joining items of array of strings the additional "dummy" string is required. Anyway as a suggestion for new implementation (of it possible, maybe it change API) I need to create separate request where use stringifor
type(string) :: strings(3)
strings(1) = 'one'
strings(2) = 'two'
strings(3) = 'three'
print "(A)", strings%join(sep='-')//'' ! print "one-two-three"
print "(A)", strings%join()//'' ! print "onetwothree" |
Ok, I see the ambiguity, but this was a designed choice, using a string as a separator to join other strings. Anyway, it is possible to implement another join method with the API you suggested. Please, open a an issue for a feature request and tomorrow I can try to implement it. |
No description provided.