Skip to content

Use of "list" vs. "vector" in Clojure Flatten Array exercise instructions #628

@usefulmove

Description

@usefulmove

I found the instructions for the Clojure Flatten Array exercise confusing because of the terminology used. The instructions mention lists, yet the tests pass vectors to the user-defined function, which can mislead learners. These are different collections in Clojure. I propose the instructions be updated to clarify that vectors are provided.

Instructions

-Take a nested list and return a single flattened list with all values except nil/null.
+Take a nested vector and return a single flattened vector with all values except nil/null.

-The challenge is to write a function that accepts an arbitrarily-deep nested list-like structure and returns a flattened structure without any nil/null values.
+The challenge is to write a function that accepts an arbitrarily-deep nested vector and returns a flattened vector without any nil/null values.

For Example

input: [1,[2,3,null,4],[null],5]

output: [1,2,3,4,5]

I am happy to submit a pull request to update the instructions if it helps.

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