Fork me on GitHub
Ahmed Hassan05:08:36

This is ns declaration in example code, why do we need empty :refer here?


It isn't empty, it is referring something named _


I was reading clj-time's doc, it said if you are using java 8 , migrate to java-time


is it going to be deprecated???


no, but java8 introduced a new time api. java-time is just a wrapper of this native java api opposed to a wrapper of an external lib (yoda-time).


it’s just better practice and will probably have better forward compatibility


So, there's no case in converting the codebase to native one


Unless you have a clear usecase for java-time > clj-time , no

Godwin Ko08:08:02

when dealing with db timestamp field, #inst is return instead of java-time object, it’s kind of annoying and require conversation in order to use java-time function library, any hints or suggestion about that?


you can register your own data reader that converts an #inst to whatever class you want, see for info on how to do that!

Alex Miller (Clojure team)12:08:08

I don’t think that’s the problem here - inst is just a print format, not a type

Alex Miller (Clojure team)12:08:34

Use class to check the actual type - it’s probably either a java.util.Date or a java.time.Instant, both of which print as #inst

Godwin Ko13:08:54

@U064X3EF3 You’re right, date field read from db is java.sql.Date, which I have to convert to java.time.LocalDate in order to use java-time library

Godwin Ko13:08:05

@U3L6TFEJF Thx for you answer. I’m using HugSql +, not sure if I can still use data reader to convert into the class that I want :thinking_face:

Alex Miller (Clojure team)13:08:48

you should be able to do that, but I've been away from jdbc for a long time

Godwin Ko13:08:50

so what other library you’d suggest to retrieve data from rdms? 🙇:skin-tone-2:

Alex Miller (Clojure team)13:08:00

you should use jdbc, I just don't remember the details of how to do what you want

Godwin Ko13:08:12

oh, but thanks anyway

Godwin Ko13:08:18

finally got what I want by using extend-protocol jdbc/IResultSetReadColumn with result-set-read-column to convert to corresponding java-time equivalent object


Hi! I’m starting to use Hiccup for some simple web frontends. I’m familiar with different web stacks but would like some pointers on idiomatic or just sensible ways to work with Hiccup. Any pointers? Also new enough with Clojure, fwiw. Thanks!


Side question - Hiccup hasn’t been updated in a while. Not that basic HTML has changed much lately, but is there any more active library I should be looking at?


nothing to worry about, many clojure libraries are very stable and “just work”


usually you get better answers that more specific you question is, “sensible ways to work with hiccup” is a very broad subject, I suggest you just mess around with it and if you run in to any blockers then ask about that 🙂


just keep in mind hiccup is just used to generate html and it's a clj only library (so no cljs), it (thankfully) does nothing else. Other than that schmee's advice is on point.

David Pham11:08:15

You can use reagent if you need Hiccup for cljs I guess


Ok, thanks all! I’ll start generating HTML and see how it feels 😄


I want to train a neural net to play chess based only on move notation