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

follow up #15951 #17478

Closed
wants to merge 6 commits into from
Closed

follow up #15951 #17478

wants to merge 6 commits into from

Conversation

ringabout
Copy link
Member

@ringabout ringabout commented Mar 23, 2021

follow up #15951 and #16280

remove compiler/strutils2 and move the procs to std/strbasics.

@@ -113,3 +113,94 @@ func strip*(a: var string, leading = true, trailing = true, chars: set[char] = w
assert c == "X"

setSlice(a, stripSlice(a, leading, trailing, chars))

proc isLowerAscii*(c: char): bool {.inline.} =
## Checks whether or not `c` is a lower case character.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Checks whether or not `c` is a lower case character.
## Checks whether or not `c` is a lowercase ASCII character.

c in {'a'..'z'}

proc isUpperAscii*(c: char): bool {.inline.} =
## Checks whether or not `c` is an upper case character.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Checks whether or not `c` is an upper case character.
## Checks whether or not `c` is an uppercase ASCII character.

@konsumlamm
Copy link
Contributor

The new procs could be funcs as far as I can tell.

@timotheecour
Copy link
Member

will review tomorrow

@ringabout ringabout mentioned this pull request Mar 24, 2021
5 tasks
if isInit and n > n0:
zeroMem(result[n0].addr, n - n0)

proc forceCopy*(result: var string, a: string) =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


proc forceCopy*(result: var string, a: string) =
## Always forces a copy no matter whether `a` is shallow.
# the naitve `result = a` would not work if `a` is shallow
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# the naitve `result = a` would not work if `a` is shallow
# the naive `result = a` would not work if `a` is shallow

@Araq
Copy link
Member

Araq commented Mar 25, 2021

Are these useful "basics" though? I never used strutils2.nim.

@Araq
Copy link
Member

Araq commented Mar 30, 2021

Sorry, rejected. Additions to strbasics must be done most carefully.

@Araq Araq closed this Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants