Fork me on GitHub

I have found that the autogensym reader macro is not applied on quoted code, e.g. 'x# yields the symbol x# rather than x__auto__1234 or similar. However other reader macros are evaluated inside of quoted code. Is there any significance to this behavior or is it an unimportant detail?


@jayvmithani x# isn't a reader macro, it's a feature of syntax-quote (`) in particular


So, I have this function that is probably wrong for multiple reasons, I'm trying to learn hugsql with little sql experience and I do not like how this function looks.

(defn update! [{id :id
                username :username
                api-key :api_key
                email :email
                password-hash :password_hash}]
  (when-some [x username] (update-username! id username))
  (when-some [x api-key] (update-api-key! id api-key))
  (when-some [x email] (update-email! id email))
  (when-some [x password-hash] (update-password-hash! id password-hash)))
I have individual functions to update each column I want to be updateable, and it seems easy to just when-some do the update, but this is fugly. Does anyone have any suggestions?


Unless anyone knows if it's possible for me to do something in hugsql where I can supply a map and update only the supplied keys with the sql.


Years of mongodb spoiled me


@alice so you're thinking of giving it the whole map but only want to update certain columns?


Well, I was unable to write hugsql/sql functions that update more than one column at a time, but this may be a me problem and not a hugsql/sql problem


and because I was only able to update one at a time, I decided a general update function would be appropriate to handle all


let's take this to #hugsql


are there any code highlighting libraries in clojure (or java) that are preferably simple and light? ideally something i could use like (highlight lang text). clojure and ruby support is a must, the more the merrier. do you know of anything like that?


[:form {:on-submit on_click :class "my form"}
How to prevent page reload when I click enter in my form?


is this using reagent?


I guess

(.preventDefault e)
is framework agnostic


the reason I ask is because I assume the reload is being caused by your DOM rendering framework


oh, sorry, you are seeing a reload, as in hitting the backend instead of a re-render of the page?


@ihorgorobets I haven’t used rum, but I think adding that preventDefault to submit event should be enough