Clojure error on thread: java.lang.IllegalArgumentException: Key must be integer

前端 未结 1 810
甜味超标
甜味超标 2021-01-26 19:31

I am puzzled by 2 things. One, the error message itself. And two, the fact that this code spins up so many threads. I was thinking it would spin up 2 or 3 threads in response to

1条回答
  •  借酒劲吻你
    2021-01-26 19:37

    #([client]
       (let [wrt (new PrintWriter (new BufferedWriter (new OutputStreamWriter (. client (getOutputStream)))))]        
         (serve-page wrt)))
    

    is nonsense. If you want a lambda with named parameters, use the fn form:

    (fn [client]
      (let [wrt (new PrintWriter (new BufferedWriter (new OutputStreamWriter (. client (getOutputStream)))))]        
        (serve-page wrt)))
    

    0 讨论(0)
提交回复
热议问题