Skip to content
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

Refactor //str and //seq #234

Closed
marcelocantos opened this issue May 10, 2020 · 4 comments
Closed

Refactor //str and //seq #234

marcelocantos opened this issue May 10, 2020 · 4 comments
Assignees
Labels
enhancement P0 High priority issue

Comments

@marcelocantos
Copy link
Contributor

Some functions currently in //str belong in //seq. Review and move.

@nofun97
Copy link
Contributor

nofun97 commented May 11, 2020

@ericzhang6222 we want to move a few functions from //str to //seq. These are the functions.

  1. contains
  2. sub
  3. split
  4. has_prefix
  5. has_suffix
  6. join

Currently these functions only work on string, you need to make them work for array and bytes too now

@ericzhang6222
Copy link
Contributor

@ericzhang6222 we want to move a few functions from //str to //seq. These are the functions.

  1. contains
  2. sub
  3. split
  4. has_prefix
  5. has_suffix
  6. join

Currently these functions only work on string, you need to make them work for array and bytes too now

Thx @nofun97

@ericzhang6222
Copy link
Contributor

ericzhang6222 commented May 11, 2020

Following functions should be moved to //seq and SEQ will support string, byte array and array:

contains
sub
split
has_prefix
has_suffix
join

ericzhang6222 added a commit that referenced this issue May 12, 2020
ericzhang6222 added a commit that referenced this issue May 12, 2020
ericzhang6222 added a commit that referenced this issue May 12, 2020
ericzhang6222 added a commit that referenced this issue May 12, 2020
ericzhang6222 added a commit that referenced this issue May 12, 2020
ericzhang6222 added a commit that referenced this issue May 20, 2020
ericzhang6222 added a commit that referenced this issue May 20, 2020
ericzhang6222 added a commit that referenced this issue May 22, 2020
ericzhang6222 added a commit that referenced this issue May 22, 2020
ericzhang6222 added a commit that referenced this issue May 22, 2020
ericzhang6222 added a commit that referenced this issue May 24, 2020
ericzhang6222 added a commit that referenced this issue May 25, 2020
ericzhang6222 added a commit that referenced this issue May 25, 2020
1. Updated `seq` library to add functions that are used for manipulating sequenced data structures including string and array. These functions are: `contains`, `has_prefix`, `has_suffix`, `sub`, `split` and `join`.
2. Changed some APIs signature, like changed `//seq.sub(subject, old, new)` to `//seq.sub(old, new, subject)`. It can help to support following code:
```
let rmspace = //seq.sub(" ", "");
rmspace("hello world"), rmspace("a b c")]
```
@ericzhang6222
Copy link
Contributor

Fixed by #240

anzopensource pushed a commit that referenced this issue Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement P0 High priority issue
Projects
None yet
Development

No branches or pull requests

3 participants