Fork me on GitHub

@bbktsk if you end up having to get lots of data in and out of java beans you might try this:


Hi! Can someone give me a hint on how to add error handling to my logic programs? I already asked in #core-logic, but it's all tumbleweeds and cricket noises there... I'd like to receive a little more information than () when my program fails to produce a result 🙂 I was thinking about a fall through case that unifies an error parameter to something meaningful, but I am not sure if that is a good idea or even how to do it well


is anyone eager to help me? pretty new to clojure so the question is pretty basic 🙂


@spaszek I am new to clojure too but that might be even better as I am familiar with some of the beginner’s struggles. Shoot 🙂


Transit seems to be the way to go for transmitting clj datastructures. ... but it seems to be work in progress: > NOTE: Transit is a work in progress and may evolve based on feedback. As a result, while Transit is a great option for transferring data between applications, it should not yet be used for storing data durably over time. This recommendation will change when the specification is complete. ... and it's been over a year since there was a commit


So I wonder: is it stable? Is it still maintained? Is it still wip? ...?


What I understand from that warning is that the details of how it encodes edn as json or messagepack is subject to change, so if you save something to disk today, there's no guarantee that you can read it back with a future version of transit. If you want to transmit data, you're good.


I wouldn't worry about a lack of commits, that probably just means it's stabilized.


allright, thx.


another transit question: in order to be able to read json data, it seems one has to stringify it first. Here's a function receiving a POST request and handling the request (using express/node.js)

(->> req
                                          (.stringify js/JSON)
                                          (t/read (t/reader :json))
It feels a bit weird to have to stringify first, but that's how it's supposed to work? (Or am I missing something?)


that seems wrong


you're going json->data->json->data there


right... my feeling as well, but how to make it work properly?

(->> req
                                          (t/read (t/reader :json)))
doesn't work - oh, that last str can be omitted, that's just to print it in a readable way.


transit does seem to take a json-string, not a json-object, if I'm right.


So, here’s a question I had over in #beginners about namespace-qualified keywords, if anyone has any thoughts. Thanks.


Just wondering where they are “tragically underused” and where/why I should be using them.


@bfabry found it: express parses json if you add (.use app (.json body-parser)). I changed that line to: (.use app (.text body-parser #js {:type "*/*"})). (I'll have to refine it a little... having type */* doesn't seem a good idea, but at least, it works now.)


has anyone had success serving '206 partial content' responses with their favourite clojure http server? i'm trying to serve streamable videos (where 206 responses are required), however doesn't seem to respond with an 'Accept-Ranges: bytes' header.


Is there a decent Clojure HTTP client that mimics browser cookie behavior? Aleph doesn’t support cookie stores, it does… something with cookies but there’s no docs so it’s not clear what — clj-http cookie handling is totally broken if the cookies get set on a redirect request


I would like to not have to have a headless browser and instrument it with selenium, but that’s lookling like an increasingly viable option