Re: Feedback on idiomatic API design

2016-03-28 Thread Johan Haleby
t; > 1) Start with data to allow clojure code to easily access your API > 2) Make generating that data simpler by writing helper functions to > generate data > 3) (Optionally) Write a DSL to make user interaction easier. > > Timothy > > On Sat, Mar 12, 2016 at 6:41 AM, J

Re: Feedback on idiomatic API design

2016-03-12 Thread Johan Haleby
you only have one > explicit binding. Essentially you'll create a let as a backquoted form and > then splice in the explicit symbol from the user: > > >`(let [~sym ...server-instance-or-uri...] ... ) > > > marc > > > > > On Sat, Mar 12, 2016 at 1:57 AM, Johan

Re: Feedback on idiomatic API design

2016-03-11 Thread Johan Haleby
ow to make it explicit (i.e. defined by the user) the way you proposed. > > On Wed, Mar 9, 2016 at 12:52 PM, Johan Haleby <johan.hal...@gmail.com> > wrote: > >> Thanks a lot for your support Marc, really appreciated. >> >> On Wed, Mar 9, 2016 at 5:33 PM, Marc Limot

Re: Feedback on idiomatic API design

2016-03-10 Thread Johan Haleby
one > server to another as it is a simple data structure. > > > On Wednesday, 9 March 2016, Marc Limotte <mslimo...@gmail.com> wrote: > >> With the macro approach, they don't need to escape it. >> >> On Wed, Mar 9, 2016 at 12:52 PM, Johan Haleby <johan.hal...@g

Re: Feedback on idiomatic API design

2016-03-09 Thread Johan Haleby
; > or, with a pre-defined server > > (def fake-server ...) > (with-fake-routes! > > route-map > > (http/get (:uri fake-server) "/x")) > > > marc > > > > On Wed, Mar 9, 2016 at 1:00 AM, Johan Haleby <johan.hal...@gmail.com> > wrot

Re: Feedback on idiomatic API design

2016-03-08 Thread Johan Haleby
On Wed, Mar 9, 2016 at 6:20 AM, Johan Haleby <johan.hal...@gmail.com> wrote: > Thanks for your feedback, exactly what I wanted. > > On Tuesday, March 8, 2016 at 3:16:02 PM UTC+1, mlimotte wrote: >> >> I don't think you need a macro here. In any case, I'd avo

Re: Feedback on idiomatic API design

2016-03-08 Thread Johan Haleby
io/resource "my.json"))} {:path "/y" :query {:q (fn [q] (clojure.string/starts-with? q "some"))}} {:status 200 :content-type "application/json" :body (slurp (io/resource "my2.json"))} } Thanks a lot for your help and feedback! > > T

Feedback on idiomatic API design

2016-03-08 Thread Johan Haleby
Hi, I've just committed an embryo of an open source project to fake http requests by starting an actual (programmable) HTTP server. Currently the API looks like this (which in my eyes doesn't look very Clojure idiomatic): (let [fake-server