Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'd rather just have a functions similar to clojure/clojurescript's get-in[0], update-in[1], assoc-in[2], dissoc-in[3] for working with nested objects/arrays. These are pretty easy to write in Python, Ruby, and Javascript, although I'm not aware of any public library that implements them. It really makes working with JSON-returning apis a breeze.

[0] - http://clojuredocs.org/clojure_core/clojure.core/get-in

[1] - http://clojuredocs.org/clojure_core/clojure.core/update-in

[2] - http://clojuredocs.org/clojure_core/clojure.core/assoc-in

[3] - http://clojuredocs.org/clojure_core/clojure.core/dissoc-in



The authors JWalk is basically get-in. Lenses, as popularised by Haskell, solve a similar problem.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: