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

Allow passing char to some joker.string functions #184

Merged
merged 1 commit into from
Mar 5, 2019

Conversation

mrichards42
Copy link

Clojure isn't entirely consistent with this, but it is common to allow passing a char as a secondary argument in functions that operate on strings (e.g. join, replace, index-of).

Adding a Stringable pseudo-type seemed like the most straightforward way to accomplish this, but it does feel a little awkward, since all the other types have generated Ensure and Assert functions. I'd be open to doing this another way if you'd prefer.

Clojure isn't entirely consistent with this, but it is common to allow
passing a char as a secondary argument in functions that operate on
strings (e.g. `join`, `replace`, `index-of`)
@candid82
Copy link
Owner

candid82 commented Mar 5, 2019

I like it. Thanks!

@candid82 candid82 merged commit 8164331 into candid82:master Mar 5, 2019
@mrichards42 mrichards42 deleted the string-char-args branch March 7, 2019 17:37
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.

2 participants