-
Notifications
You must be signed in to change notification settings - Fork 0
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
rfactor and fix the 5 different (buggy) re-implementations of cmpIgnoreStyle #472
Comments
I already plan to refactor them and place them in std/private/str*. Use templates so that make cstrutils support JS backend. |
@xflywind
can be discussed in your PR, but here's how to get best of both worlds:
# proc fn[T: openArray[char] or cstring](a: T) = # nim BUG: this doesn't work
template fnImpl(a): untyped =
# xxx: actual impl goes here
for ai in a: echo (ai,)
proc fn(a: openArray[char]) = fnImpl(a)
proc fn(a: cstring) = fnImpl(a)
proc fn(a: string) = fnImpl(a)
proc main()=
fn("abc")
var b = "abc".cstring
fn(b)
fn(['a','b'])
main()
static: main() |
I won't consider VM backend in this PR too much. |
Maybe we also need |
|
the ones that are actually intended to be case insensitive should be renamed to something else, or cmpIgnoreStyle can get an extra param
caseInsensitive = false
links
nim-lang#16391
nim-lang#16392
The text was updated successfully, but these errors were encountered: