-
Notifications
You must be signed in to change notification settings - Fork 8
Replace string_split impl with string_split_noregexp #351
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -178,29 +178,15 @@ Both arguments must be actual strings. | |
|
|
||
| Returns an empty list when `string` is an empty string. | ||
|
|
||
| **DEPRECATED** where `separator` is a regular expression. That behavior was | ||
| unintentional, and in conflict with this library's design goal to have no | ||
| dependency on the Java language or library. | ||
|
|
||
| * Callers needing to split based on regular expressions should use | ||
| `regexp_split` from the [FusionJavaRegexp][] package, being careful to adapt code to that method's | ||
| different argument order, result type (sexp instead of immutable list), and | ||
| edge cases around leading matches. Test your code thoroughly. | ||
| * Callers needing separators that are escaped to avoid being regular | ||
| expressions should use [`string_split_noregexp`][ssn] until the regexp | ||
| behavior is removed from this procedure. For example, replace: | ||
|
|
||
| (string_split txt "\\\\.") | ||
|
|
||
| with: | ||
|
|
||
| (require "/fusion/experimental/string") | ||
| (string_split_noregexp txt ".") | ||
| The `separator` is _not_ a regular expression; callers needing that feature | ||
| should use `regexp_split` from the [FusionJavaRegexp][] package, being careful | ||
|
Comment on lines
+181
to
+182
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This prose needs updating: the reference to The relevant So we should strip out most of this beyond the semantic clarification. If you're interested in working on #159 (the regexp integration), please comment on that issue (or reach out on Discord) and ask me to sketch out the approach I have in mind. |
||
| to adapt code to that method's different argument order, result type (sexp | ||
| instead of immutable list), and edge cases around leading matches. Test your | ||
| code thoroughly. | ||
|
|
||
| [FusionJavaRegexp]: wiki:FusionJavaRegexp | ||
| [ssn]: fusion/experimental/string.html#string_split_noregexp | ||
| ''' | ||
| (java_new "dev.ionfusion.fusion.FusionString$SplitProc")) | ||
| (java_new "dev.ionfusion.fusion.FusionString$SplitNoRegexpProc")) | ||
|
|
||
| (define_values (string_starts_with) | ||
| ''' | ||
|
|
||
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.
Did this removal not break test cases?
🤔
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.
Oops, it did: https://github.com/ion-fusion/fusion-java/actions/runs/19654525460/job/56291878967?pr=351#step:5:57-60
You can test locally using the
checktarget.I recommend running
./gradlew clean releaseon each PR to ensure full build/test success.