clojure-india

IN/Clojure 2020 | https://inclojure.org | https://twitter.com/in_clojure
udit 2017-03-08T09:06:03.000034Z

Coming from a Java background to Clojure the very first thing I googled was how to implement classes and interfaces in clojure to get things done. But that’s not idiomatic clojure (tbh what I ended up with was a disaster in retrospect). My advice would be to ramp up on the basic data structures - map, lists, vectors and their operations. And then write clojure which does what your Java code does. Also take off your OO hat 🙂

1
udit 2017-03-08T09:07:07.000035Z

@niten.sagar also if you want to use some java libraries use what @kumarshantanu said.

bg 2017-03-08T09:23:33.000037Z

It's important to learn how to think functionally and not to translate code written in X to Clojure.

2017-03-08T09:44:50.000038Z

@kumarshantanu @udit @bg Thanks for your suggestion. Basically my current work requires me to extract data from ads API like Adword, Bing etc and all this brand have java library. Therefore i need to integrate this library in clojure project.

2017-03-08T09:53:03.000039Z

@niten.sagar niten.sagar here’s a simple library that might help you write interop code: https://github.com/codonnell/uri/blob/master/src/uri/core.clj

2017-03-08T09:53:54.000041Z

it creates clojure fns that delegate down to the underlying java lib.

2017-03-08T14:07:53.000042Z

@niten.sagar for accessing Adwords/Bing reports you can take a look at: https://github.com/uswitch/adworj https://github.com/uswitch/binj they might be enough for your needs