Mike Sullivan
Mike Sullivan

Reputation: 27

clojurecademy, thread macro challenge

I'm currently working through clojurecademy and came across this problem which I can't seem to solve -

(= (#_blank (sort (rest (reverse [2 5 4 1 3 6]))))
   (-> [2 5 4 1 3 6] (reverse) (rest) (sort) (#_blank))
   5)

I only need to enter enough to fill in the blank, at first I thought it was just asking me to write what these functions would return, which I think would be (1 2 3 4 5) but that's not correct, I can't figure out why there is a 5 passed in the the equal function, I was thinking maybe I needed to add a function that references 5 from the returned list but I'm not sure how to do that either (without a defined variable) I could be way off...

This is clojurecademy, Problems - Elementary question number 23

Upvotes: 0

Views: 64

Answers (1)

Kyle Grierson
Kyle Grierson

Reputation: 346

The challenge is to make each expression return 5.

As = can take multiple values for equality, Clojure Academy have included 5 within the check too ensure the two expresions you need to complete also return 5.

I would recommend trying to get this expression to return 5

(#_blank (sort (rest (reverse [2 5 4 1 3 6]))))

then work on the next expression to return 5.

Upvotes: 1

Related Questions