Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doc on how one function can beget another in clojurescript?

I'm trying to learn clojurescript through this cool site clojurescriptkoans

There's a problem, I'm a bit stumped on a sample question.

Question:

Could anyone give me a clue like link me docs docs to help me answer?

One function can beget another.

(= 9 (((fn [] _____ )) 4 5))

REF: http://clojurescriptkoans.com/#functions/7

like image 825
Armeen Harwood Avatar asked Jan 05 '23 18:01

Armeen Harwood


1 Answers

Your anonymous function takes no arguments; when it is called (as is the case here), it has to return something that takes 4 and 5 as arguments, and returns 9. That something is simply another function called +:

(= 9 (((fn [] + )) 4 5))

like image 96
Jan Van den bosch Avatar answered Jan 08 '23 08:01

Jan Van den bosch