Am Dienstag, 10. Januar 2017 01:19:16 UTC+1 schrieb Didier:
>
> How would you declare a namespace within a namespace? Or two namespaces in
> the same file?
>
>
You can do so quite easily.
(ns foo.bar)
(defmulti a :dispatch)
(defn b
[x]
(str "Called a. This was the result: " (a x
Whenever I code something like this I get the feeling a clojure guru could
do it more simply, and I love learning new tricks.
Here is my simple (real-world, btw) problem and solution. Is there a better
way?
;; Problem: given optimized* json maps (* to avoid duplicating keys):
(def optij {:name
On Tuesday, January 10, 2017 at 9:27:24 AM UTC-6, hiskennyness wrote:
>
> Whenever I code something like this I get the feeling a clojure guru could
> do it more simply, and I love learning new tricks.
>
> Here is my simple (real-world, btw) problem and solution. Is there a
> better way?
>
> ;;
With specter:
(map-indexed (fn [i name] (sp/transform sp/MAP-VALS #(nth % i) optij))
(:name optij))
=> ({:name :tom, :age 1, :tone :do} {:name :dick, :age 2, :tone :re} {:name
:harry, :age 3, :tone :mi})
Without:
(map-indexed (fn [i name] (into {} (map (fn [[k v]] [k (nth v i)]) optij)))
(:na
sorry that last nth should've been (nth % i nil)
On Tuesday, January 10, 2017 at 11:37:22 AM UTC-8, Beau Fabry wrote:
>
> With specter:
>
> (map-indexed (fn [i name] (sp/transform sp/MAP-VALS #(nth % i) optij))
> (:name optij))
> => ({:name :tom, :age 1, :tone :do} {:name :dick, :age 2, :tone :re
There is a path traversal vulnerability in Ring that affects applications
that serve resources from the filesystem. It does not affect Ring sites
deployed as uberjars.
Versions affected: Every version prior to 1.5.1; 1.6.0-beta1 to 1.6.0-beta6
Fixed versions: 1.5.1, 1.6.0-beta7
Link: https://git
On Tuesday, January 10, 2017 at 1:59:05 PM UTC-5, Francis Avila wrote:
>
>
>
> On Tuesday, January 10, 2017 at 9:27:24 AM UTC-6, hiskennyness wrote:
>>
>> Whenever I code something like this I get the feeling a clojure guru
>> could do it more simply, and I love learning new tricks.
>>
>> Here i
On Tuesday, January 10, 2017 at 2:37:22 PM UTC-5, Beau Fabry wrote:
>
> With specter:
>
> (map-indexed (fn [i name] (sp/transform sp/MAP-VALS #(nth % i) optij))
> (:name optij))
> => ({:name :tom, :age 1, :tone :do} {:name :dick, :age 2, :tone :re}
> {:name :harry, :age 3, :tone :mi})
>
One li
Haha, the one line was more an artifact of me entering it that way than a
recommendation, if I was committing to master it would probably look like
(map-indexed
(fn [person-num _person_name]
(->> optij
(map (fn [[attribute-name attribute-vals]] {attribute-name (nth
attribute-vals p
Very nice. Thank you.
One question because my ignorance about how to configure plugins in
general--I hope you don't mind. Where would I put this:
{:ultra {:repl {:width 180
:map-delimiter ""
:extend-notation true
:print-meta true
One more question--should have included it before. Is there a way to
change the print width apart from in profile.clj or project.clj, e.g. with
a function in the repl. That way I resize the terminal to see more on each
line, I wouldn't have to exit out and change the width. Thanks-
--
You r
Hey there!
To answer your first question, I keep this sort of configuration in my
~/.lein/profiles.clj. That file looks like this right now:
{:user {:ultra {:repl true}
:plugins [[venantius/ultra "0.5.1"]
[lein-pprint "1.1.2"]]}}
To answer your second question -- the pr
12 matches
Mail list logo