clojure - returning a data type from a fn literal -


the below expression works -

((fn[n][(take n (range))]) 10) 

while below throws error -

(#([(take % (range))]) 10) 

why cant return data type function literal ?

if absolutely want return "data" anonymous function using # reader macro use do.

#(do [1 2]) 

as @mars said have alternative use vector function.

#(vector 1 2) 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -