Re: How I can catch exception from cheshire.core?

2013-09-11 Thread Алексей Александров
oming from the realization step. > > > On Wed, Sep 11, 2013 at 4:56 AM, Алексей Александров < > alexeyaleksand...@gmail.com> wrote: > >> Hello. >> >> I'm trying catch exception from cheshire.core/decode (or parse-string). >> But it didn't work &

How I can catch exception from cheshire.core?

2013-09-11 Thread Алексей Александров
Hello. I'm trying catch exception from cheshire.core/decode (or parse-string). But it didn't work user=> (require ['cheshire.core :as 'json]) user=> (try (json/decode "[{\"id\":ty\":1}]") (catch Throwable _ (println "I catched exception"))) JsonParseException Unrecognized token 'ty': was expectin

Re: using partial with ->

2013-06-07 Thread Алексей Александров
Because (partial map first) return function => (-> [[1 2] [3 4] [5]] (partial map first)) # you should call function to get result => (-> [[1 2] [3 4] [5]] ((partial map first)) flatten) (1 3 5) 2013/6/8 Matt Smith > Newbie question here. This code: > > (println (flatten(map first '([1 2] [3