Skip to content

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

Open
@rwtolbert

Description

@rwtolbert

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions