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

Inconsistencies between return values - filter/distinct vs drop-while/drop-until #1548

Open
rwtolbert opened this issue Jan 23, 2025 · 1 comment

Comments

@rwtolbert
Copy link
Contributor

filter and distinct always return an array, regardless of input:

repl:3:> (distinct @[1 2 3 0 -4 2 3])
@[1 2 3 0 -4]
repl:4:> (filter pos? [1 2 3 0 -4 2 3])
@[1 2 3 2 3]
repl:10:> (distinct "bookkeeper")
@[98 111 107 101 112 114]

whereas drop-while and drop-until return either a tuple or string

repl:2:> (drop-until |(< $ 65) "foo123bar")
"123bar"
repl:3:> (drop-while pos? @[1 2 3 0 -4 2 3])
(0 -4 2 3)

seems like drop-while and drop-until should at least return an array when given an array.

@sogaiu
Copy link
Contributor

sogaiu commented Jan 24, 2025

For reference, it looks like the drop-* siblings used to return arrays and that changed here.

Found some PRs that might give some hints about the current state of things:

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

No branches or pull requests

2 participants