Re: Private multimethods possible?

2017-01-10 Thread Meikel Brandmeyer (kotarak)


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)))

  (ns foo.bar.hidden)
  (alias 'parent 'foo.bar)

  (defmethod parent/a :yoyo
[x]
(str "yoyo: " (:value x)))

  (defmethod parent/a :dyne
[x]
(str "dyne: " (:value x)))

  ; Go back to original namespace.
  (in-ns 'foo.bar)

As you can try in the repl, this works.

  user=> (require 'foo.bar)
  nil
  user=> (foo.bar/b {:dispatch :yoyo :value 5})
  "Called a. This was the result: yoyo: 5"
  user=> (foo.bar/b {:dispatch :dyne :value 5})
  "Called a. This was the result: dyne: 5"

That said: I wouldn't recommend this. I'm not sure, I see a situation that 
would justify the weirdness and hidden complexities of this approach. Too 
much rope... If you really need this style of thing, put the hidden 
namespace in its own file and use load.

Kind regards
Meikel

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Simple clojure example improvements sought

2017-01-10 Thread hiskennyness
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 [:tom :dick :harry]
   :age [1 2 3]
   :tone [:do :re :mi]})

;; ... produce normal repetitious maps
(comment
  [{:name :tom, :age 1, :tone :do}
   {:name :dick, :age 2, :tone :re}
   {:name :harry, :age 3, :tone :mi}])

;; goal #1: pivot so I can use zipmap
(comment
  ((:tom 1 :do) (:dick 2 :re) (:harry 3 :mi)))

;; my goal #1 approach (improvements welcome):
(apply (partial map (fn [& vs] vs))
   (vals optij))

(apply (partial map vector)
   (vals optij))

;; my overall approach (improvements welcome):
(let [ks (keys optij)
  vs-pivoted (apply (partial map vector)
(vals optij))]
  (vec (for [attributes vs-pivoted]
 (zipmap ks attributes


Final fun question: is the original idea of compressing JSON this way 
commonplace? I thought everyone was just saying to hell with the 
duplication and taking the convenience of self-defining objects, but 
apparently one source is not.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple clojure example improvements sought

2017-01-10 Thread Francis Avila


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?
>
> ;; Problem: given optimized* json maps (* to avoid duplicating keys):
> (def optij {:name [:tom :dick :harry]
>:age [1 2 3]
>:tone [:do :re :mi]})
>
> ;; ... produce normal repetitious maps
> (comment
>   [{:name :tom, :age 1, :tone :do}
>{:name :dick, :age 2, :tone :re}
>{:name :harry, :age 3, :tone :mi}])
>
> ;; goal #1: pivot so I can use zipmap
> (comment
>   ((:tom 1 :do) (:dick 2 :re) (:harry 3 :mi)))
>
> ;; my goal #1 approach (improvements welcome):
> (apply (partial map (fn [& vs] vs))
>(vals optij))
>
> (apply (partial map vector)
>(vals optij))
>
>

Your partials are not strictly necessary, apply "auto-partials" all but the 
last argument:

(apply map vector (vals optij))

 
 

> ;; my overall approach (improvements welcome):
> (let [ks (keys optij)
>   vs-pivoted (apply (partial map vector)
> (vals optij))]
>   (vec (for [attributes vs-pivoted]
>  (zipmap ks attributes
>
>

This is a minor variation that uses transducers:
(let [ks (keys optij)
  vs-pivoted (apply map vector (vals optij))]
  (into [] (map #(zipmap ks %)) vs-pivoted)) 

This is a slightly different approach that combines keys and values first, 
then pivots:

(->> optij
 (map (fn [[attr vs]] (mapv #(do [attr %]) vs)))
 ;; [[[:name :tom][:name :dick]...], [[:age 1]...]]
 (apply mapv (fn [& cols]
   ;; cols ([:name :tom] [:age 1] [:tone :do])
   (into {} cols

This is a non-lazy approach that builds up the rows in multiple passes 
without intermediate pivots or seqs:

(reduce-kv (fn [rows k cols]
 (reduce-kv
   (fn [rows i col]
 (assoc-in rows [i k] col))
   rows cols)) 
  []
  optij)


Final fun question: is the original idea of compressing JSON this way 
> commonplace? I thought everyone was just saying to hell with the 
> duplication and taking the convenience of self-defining objects, but 
> apparently one source is not.
>

I don't know.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple clojure example improvements sought

2017-01-10 Thread Beau Fabry
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))) 
(:name optij))
=> ({:name :tom, :age 1, :tone :do} {:name :dick, :age 2, :tone :re} {:name 
:harry, :age 3, :tone :mi})

If I didn't know which key was the canonical full list, ie some could be 
shorter and in that case I wanted nil:

(map (fn [i] (sp/transform sp/MAP-VALS #(nth % i) optij)) (range 0 (inc 
(apply max (map (comp count vals) optij)
=> ({:name :tom, :age 1, :tone :do} {:name :dick, :age 2, :tone :re} {:name 
:harry, :age 3, :tone :mi})


On Tuesday, January 10, 2017 at 7:27:24 AM UTC-8, 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?
>
> ;; Problem: given optimized* json maps (* to avoid duplicating keys):
> (def optij {:name [:tom :dick :harry]
>:age [1 2 3]
>:tone [:do :re :mi]})
>
> ;; ... produce normal repetitious maps
> (comment
>   [{:name :tom, :age 1, :tone :do}
>{:name :dick, :age 2, :tone :re}
>{:name :harry, :age 3, :tone :mi}])
>
> ;; goal #1: pivot so I can use zipmap
> (comment
>   ((:tom 1 :do) (:dick 2 :re) (:harry 3 :mi)))
>
> ;; my goal #1 approach (improvements welcome):
> (apply (partial map (fn [& vs] vs))
>(vals optij))
>
> (apply (partial map vector)
>(vals optij))
>
> ;; my overall approach (improvements welcome):
> (let [ks (keys optij)
>   vs-pivoted (apply (partial map vector)
> (vals optij))]
>   (vec (for [attributes vs-pivoted]
>  (zipmap ks attributes
>
>
> Final fun question: is the original idea of compressing JSON this way 
> commonplace? I thought everyone was just saying to hell with the 
> duplication and taking the convenience of self-defining objects, but 
> apparently one source is not.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple clojure example improvements sought

2017-01-10 Thread Beau Fabry
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} 
> {:name :harry, :age 3, :tone :mi})
>
> Without:
>
> (map-indexed (fn [i name] (into {} (map (fn [[k v]] [k (nth v i)]) 
> optij))) (:name optij))
> => ({:name :tom, :age 1, :tone :do} {:name :dick, :age 2, :tone :re} 
> {:name :harry, :age 3, :tone :mi})
>
> If I didn't know which key was the canonical full list, ie some could be 
> shorter and in that case I wanted nil:
>
> (map (fn [i] (sp/transform sp/MAP-VALS #(nth % i) optij)) (range 0 (inc 
> (apply max (map (comp count vals) optij)
> => ({:name :tom, :age 1, :tone :do} {:name :dick, :age 2, :tone :re} 
> {:name :harry, :age 3, :tone :mi})
>
>
> On Tuesday, January 10, 2017 at 7:27:24 AM UTC-8, 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?
>>
>> ;; Problem: given optimized* json maps (* to avoid duplicating keys):
>> (def optij {:name [:tom :dick :harry]
>>:age [1 2 3]
>>:tone [:do :re :mi]})
>>
>> ;; ... produce normal repetitious maps
>> (comment
>>   [{:name :tom, :age 1, :tone :do}
>>{:name :dick, :age 2, :tone :re}
>>{:name :harry, :age 3, :tone :mi}])
>>
>> ;; goal #1: pivot so I can use zipmap
>> (comment
>>   ((:tom 1 :do) (:dick 2 :re) (:harry 3 :mi)))
>>
>> ;; my goal #1 approach (improvements welcome):
>> (apply (partial map (fn [& vs] vs))
>>(vals optij))
>>
>> (apply (partial map vector)
>>(vals optij))
>>
>> ;; my overall approach (improvements welcome):
>> (let [ks (keys optij)
>>   vs-pivoted (apply (partial map vector)
>> (vals optij))]
>>   (vec (for [attributes vs-pivoted]
>>  (zipmap ks attributes
>>
>>
>> Final fun question: is the original idea of compressing JSON this way 
>> commonplace? I thought everyone was just saying to hell with the 
>> duplication and taking the convenience of self-defining objects, but 
>> apparently one source is not.
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] Ring 1.5.1 released to fix path traversal vulnerability

2017-01-10 Thread James Reeves
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://github.com/ring-clojure/ring

*Overview*

This vulnerability is caused by a bug in the
ring.util.response/resource-response function. An attacker can use this
vulnerability to access files that are in a directory on the classpath, but
they cannot access resources contained in a jar.

This also affects the ring.middleware.resource/wrap-resource middleware,
and the compojure.route/resources function.

*Example*

Consider a minimal Compojure application:

(ns example.core
  (:require [compojure.core :refer :all]
[compojure.route :as route]))

(defroutes app
  (GET "/" [] "Hello World")
  (route/resources "/")
  (route/not-found "Not Found"))

Assume that this isn't packaged as an jar when deployed, but is deployed as
a directory of source files. An attacker can craft a URL to read any file
on the classpath that is not in a jar:

curl -vvv --path-as-is 'http://localhost:3000//../example/core.clj'

*Cause*

Unlike the file-response function, the resource-response function did not
properly santize the path from the client.

*Fix*

The resource-response function now checks for path segments containing
"..", and also ensures that for file-based resources, the canonical
filepath of the resource must be contained within the canonical filepath of
the :root option.

This fix means that Ring will not follow symlinks on the classpath if they
lead to files or directories outside the path specified in the :root option.
If you happen to need this for any reason, then you need to set the
:allow-symlinks? option to true.

*Recommendation*

Upgrade to 1.5.1 as soon as possible.

*Credit*

Thanks go Tim McCormack for discovering this vulnerability, and his
responsible disclosure of it. Thanks also go to Dmitri Sotnikov for
reviewing the fix.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple clojure example improvements sought

2017-01-10 Thread hiskennyness


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 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 [:tom :dick :harry]
>>:age [1 2 3]
>>:tone [:do :re :mi]})
>>
>> ;; ... produce normal repetitious maps
>> (comment
>>   [{:name :tom, :age 1, :tone :do}
>>{:name :dick, :age 2, :tone :re}
>>{:name :harry, :age 3, :tone :mi}])
>>
>> ;; goal #1: pivot so I can use zipmap
>> (comment
>>   ((:tom 1 :do) (:dick 2 :re) (:harry 3 :mi)))
>>
>> ;; my goal #1 approach (improvements welcome):
>> (apply (partial map (fn [& vs] vs))
>>(vals optij))
>>
>> (apply (partial map vector)
>>(vals optij))
>>
>>
>
> Your partials are not strictly necessary, apply "auto-partials" all but 
> the last argument:
>
> (apply map vector (vals optij))
>
>
Awesome. I tried applying map and it failed I guess because of something 
else so I gave up on it too soon.
 

>  
>  
>
>> ;; my overall approach (improvements welcome):
>> (let [ks (keys optij)
>>   vs-pivoted (apply (partial map vector)
>> (vals optij))]
>>   (vec (for [attributes vs-pivoted]
>>  (zipmap ks attributes
>>
>>
>
> This is a minor variation that uses transducers:
> (let [ks (keys optij)
>   vs-pivoted (apply map vector (vals optij))]
>   (into [] (map #(zipmap ks %)) vs-pivoted)) 
>

Nice. I fall back onto for-loops too quickly.
 

>
>
> This is a slightly different approach that combines keys and values first, 
> then pivots:
>
> (->> optij
>  (map (fn [[attr vs]] (mapv #(do [attr %]) vs)))
>  ;; [[[:name :tom][:name :dick]...], [[:age 1]...]]
>  (apply mapv (fn [& cols]
>;; cols ([:name :tom] [:age 1] [:tone :do])
>(into {} cols
>
> This is a non-lazy approach that builds up the rows in multiple passes 
> without intermediate pivots or seqs:
>
> (reduce-kv (fn [rows k cols]
>  (reduce-kv
>(fn [rows i col]
>  (assoc-in rows [i k] col))
>rows cols)) 
>   []
>   optij)
>
>
Sweet. I did actually code originally something that plucked values by 
column but decided to try the pivot approach because my plucking was not as 
terse as that.

Thx!

-kt

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple clojure example improvements sought

2017-01-10 Thread hiskennyness


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 line! With specter, but still nice.

But to me this is the downside of specter and even Clojure: the code starts 
to get opaque. I am reminded of the C Puzzle Book which offered simple data 
and a few lines of code and defied us to guess what the code produced.

My big take-away here is map-indexed. Forgot about that and it would have 
greatly simplified my original efforts.
 

>
> Without:
>
> (map-indexed (fn [i name] (into {} (map (fn [[k v]] [k (nth v i)]) 
> optij))) (:name optij))
> => ({:name :tom, :age 1, :tone :do} {:name :dick, :age 2, :tone :re} 
> {:name :harry, :age 3, :tone :mi})
>
>
Gonna have to study that one. :) Still one line, tho! Cool.

-kt

>
>>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple clojure example improvements sought

2017-01-10 Thread Beau Fabry
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 person-num)}))
(into {})))
  (:name optij))

On Tuesday, January 10, 2017 at 6:13:28 PM UTC-8, hiskennyness wrote:
>
>
>
> 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 line! With specter, but still nice.
>
> But to me this is the downside of specter and even Clojure: the code 
> starts to get opaque. I am reminded of the C Puzzle Book which offered 
> simple data and a few lines of code and defied us to guess what the code 
> produced.
>
> My big take-away here is map-indexed. Forgot about that and it would have 
> greatly simplified my original efforts.
>  
>
>>
>> Without:
>>
>> (map-indexed (fn [i name] (into {} (map (fn [[k v]] [k (nth v i)]) 
>> optij))) (:name optij))
>> => ({:name :tom, :age 1, :tone :do} {:name :dick, :age 2, :tone :re} 
>> {:name :harry, :age 3, :tone :mi})
>>
>>
> Gonna have to study that one. :) Still one line, tho! Cool.
>
> -kt
>
>>
>>>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Ultra v0.5.1 - a Leiningen plugin for a superior development environment

2017-01-10 Thread Mars0i
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
 ...}}}

(I didn't find the Whidbey README to be helpful, but maybe I missed some 
implication there.)


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Ultra v0.5.1 - a Leiningen plugin for a superior development environment

2017-01-10 Thread Mars0i
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 received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Ultra v0.5.1 - a Leiningen plugin for a superior development environment

2017-01-10 Thread W. David Jarvis
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 printer configuration sits as a
dynamic var over in whidbey.repl/printer. There's a convenience function
you can access directly -- whidbey.repl/update-options! that will call
`alter-var-root` on the configuration for you. So your standard usage would
be something like [untested]:

 (whidbey.repl/update-options! (assoc whidbey.repl/printer :your-new-key
your-new-val))

Personally, if I run into something like that I usually just restart my
repl, but hopefully the above is helpful.

Cheers,

 ~ V

On Tue, Jan 10, 2017 at 9:37 PM, Mars0i  wrote:

> 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 received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/to
> pic/clojure/OjRe5WXaXBE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 203.918.2328
>
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.