Fork me on GitHub
#clojure-italy
<
2019-12-05
>
andrea.crotti09:12:15

Vorrà dire sostituire Excel con google sheets

Andrea Imparato09:12:21

domanda clojuristica

Andrea Imparato09:12:57

codice scritto così può piacervi o secondo voi c’è un modo + idiomatico per scriverlo?

(->>
   (get-in parsed-json ["data" "items"])
   (vals)
   (map #(get % "byDate") )
   (mapcat keys))

Andrea Imparato09:12:10

(è codice per parsare del json)

reborg10:12:37

peccato che le stringhe non funzionino come le keyword eh?

reborg10:12:19

non molto mi sembra, puoi uccidere un map e togliere il get con (->> (get-in parsed-json ["data" "items"]) vals (mapcat (comp keys #(% "byDate"))))

Andrea Imparato11:12:04

ottimo, grazie per la risposta 🙂

Andrea Imparato11:12:35

sì ho pensato anche io magari potevo trasformare le stringhe in keyword ma non so quanti benefici ne posso trarre

Andrea Imparato11:12:02

cioè magari il codice è + facile da scrivere ma le performance peggiori se il json è grande?

reborg13:12:00

un minimo si’. In generale transformo solo se ne ho bisogno ma se posso farne a meno lascio stringhe.

skuro10:12:54

ave tutti!

skuro10:12:27

Dutch Clojure Days e' stata annunciata, i dettagli li trovate o su http://clojuredays.org o su #announcements 😉

reborg10:12:01

evviva gli organizers!

reborg10:12:50

metto sul cal