PARSE returns input on success, PARSE? variant #202
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements #2165 where PARSE is to return the input series on
success, and NONE on false, unless a RETURN is used to override it
(in the future, COLLECT would override it as well).
It also implements a twist, with a PARSE? variation that can only
return TRUE or FALSE. Since it ends in a question mark, the idea that
it act exactly like the old PARSE isn't a precise match...as the rule
is that functions ending in question mark return only true or false.
As one possible way of pushing that rule through, the PARSE? variant
does not tolerate RETURN (unless it is a return of a LOGIC!) and
will error.
This makes PARSE? suitable for use in practically every case where the
previous desire to return a TRUE or a FALSE was desired. In the cases
where it was not, the PARSE variant makes more sense.
Legacy support uses a heuristic to make a good guess about what the
original PARSE output would have been, but can be tripped up if a
RETURN happened to return the series at the input position.
This is an experiment to see how it goes and if it turns out to be
of benefit.