Clojure: returning a vector from an anonymous function

后端 未结 3 1961
盖世英雄少女心
盖世英雄少女心 2020-12-14 17:14

I wrote a small anonymous function to be used with a map call. The function returns a vector containing a column name and column value from a SQL result set que

3条回答
  •  温柔的废话
    2020-12-14 17:36

    Your problem is that the simple syntax is trying to evaluate the vector as a function call.

    You can insert an "identity" function to make it work, as this is just a simple function that will return the vector unchanged:

    #(identity [(keyword %) (.getObject resultset %)])
    

提交回复
热议问题