Skip to content

SPLIT intrinsic #187

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

Open
certik opened this issue Oct 27, 2020 · 4 comments
Open

SPLIT intrinsic #187

certik opened this issue Oct 27, 2020 · 4 comments
Assignees
Labels
Fortran 2023 Proposal targeting the next Fortran standard F2023 (previously called F202X)

Comments

@certik
Copy link
Member

certik commented Oct 27, 2020

US03 - SPLIT string intrinsic

@certik certik added the Fortran 2023 Proposal targeting the next Fortran standard F2023 (previously called F202X) label Oct 27, 2020
@certik
Copy link
Member Author

certik commented Oct 27, 2020

This is a great candidate for an stdlib implementation: fortran-lang/stdlib#241

@milancurcic
Copy link
Member

Definition of SPLIT is in 16.9.194 of 20-007.

@milancurcic
Copy link
Member

I put an implementation here: https://github.com/milancurcic/fortran202x_split. I will request feedback in the stdlib issue.

@milancurcic
Copy link
Member

We discussed the split API on a call on Tuesday. You can watch the recording here.

On the call we came to an overall tentative agreement that the 3rd form of split may be not appropriate or intuitive to be part of the split functionality. As a reminder, the 3 forms of split, after 20-007 and 20-139 are:

  1. SPLIT (STRING, SET, TOKENS [, SEPARATOR])
  2. SPLIT (STRING, SET, FIRST, LAST)
  3. SPLIT (STRING, SET, POS [, BACK])

While we found that the first two forms are useful and meaningful for split, we also found that the 3rd form is not appropriate because it doesn't actually do any splitting. Instead, it does "finding", which is more akin to the intrinsic index. Bundling the 3rd form of the currently approved split with the other two may thus be confusing to Fortran programmers.

We decided to write a proposal against exclude the 3rd form in the split intrinsic for F202X. I have agreed to take a lead on it. I plan to have a PR draft in this repo by early December, so it can be discussed ahead of time both here and on the J3 mailing list and/or forum well ahead of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fortran 2023 Proposal targeting the next Fortran standard F2023 (previously called F202X)
Projects
None yet
Development

No branches or pull requests

2 participants