Re: Multiple key-value pairs in assoc-in (old issue)

2016-08-14 Thread Andy Fingerhut
Of course you can copy the newer definition of assoc-in into your own projects 
and use it if you like, but that probably doesn't prevent your little bit of 
sadness.

Andy

Sent from my iPhone

> On Aug 14, 2016, at 5:27 AM, Łukasz Kożuchowski 
>  wrote:
> 
> I am a little sad now. Thanks for explaining!
> 
> Łukasz Kożuchowski
> 
> 
>> On Aug 13, 2016 4:56 PM, "Andy Fingerhut"  wrote:
>> That ticket is in a state called "Triaged", which means that a screener 
>> (most likely Alex Miller) thinks the issue is good enough for Rich Hickey to 
>> take a look at it some time.  Rich probably hasn't looked at it yet, because 
>> if he had, it would have likely been changed to Declined or Vetted.
>> 
>> As far as expectations go, there are enough other things being worked on for 
>> Clojure 1.9 that I would not bet any money this ticket will make it in to 
>> that version.  Disclaimer: I am only an observer in this, not a 
>> decision-maker.
>> 
>> Andy
>> 
>>> On Sat, Aug 13, 2016 at 4:18 AM, Łukasz Kożuchowski 
>>>  wrote:
>>> Hello,
>>> 
>>> Currently assoc-in does not support multiple key-value pairs the way assoc 
>>> does.
>>> 
>>> user=> (assoc {} :a 1 :b 2)
>>> {:b 2, :a 1}
>>> user=> (assoc-in {} [:a :b] 1 [:c :d] 2)
>>> ArityException Wrong number of args (5) passed to: core$assoc-in 
>>> clojure.lang.AFn.throwArity (AFn.java:437)
>>> 
>>> It appears a patch for this has been ready for more than a year:
>>> http://dev.clojure.org/jira/browse/CLJ-1771
>>> 
>>> Can we expect this to work soon?
>>> 
>>> -- 
>>>   Łukasz Kożuchowski
>>> 
>>> -- 
>>> 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.
>> 
>> -- 
>> 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.
> 
> -- 
> 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.

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


'lein trampoline test' fails on first run with 'No implementation of method'

2016-08-14 Thread Brian Craft
With an empty target directory 'lein trampoline test' fails with a protocol 
exception, 'No implementation of method'.

Running 'lein test' works fine. After running 'lein test', 'lein trampoline 
test' also works.

Anyone know what's going on? Seems like something isn't being compiled, or 
loaded, but I don't know why.

-- 
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: grouping and mapping

2016-08-14 Thread Steve Miner
Sorry, I got the semantics of the grouping-fn wrong.  My code assumes that the 
key is always first in the elements and my grouping is more like a merging-fn.

> On Aug 14, 2016, at 2:53 PM, miner  wrote:
> 
> If your data elements are essentially map-entries (key-value pairs), I'd use 
> reduce.  Maybe something like this would work for you...
> 
> (defn mapping-group-by [grouping-fn mapping-fn coll]
>   (reduce (fn [res [k v]] (update res k grouping-fn (mapping-fn v)))
>   {}
>   coll))
> 
> (def foos [[:a "foo"]  [:b "bar"]  [:a "baz"]])
> 
> (mapping-group-by conj clojure.string/upper-case foos)
> ;;=> {:a ("BAZ" "FOO"), :b ("BAR")}
> 
> If you need vector values, you can wrap `conj` with `fnil` to get a vector.
> 
> (mapping-group-by (fnil conj []) clojure.string/upper-case foos)
> ;;=> {:a ["FOO" "BAZ"] :b ["BAR"]}
> 
> 
> -- 
> 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 
> .

-- 
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: grouping and mapping

2016-08-14 Thread miner
If your data elements are essentially map-entries (key-value pairs), I'd 
use reduce.  Maybe something like this would work for you...

(defn mapping-group-by [grouping-fn mapping-fn coll]
  (reduce (fn [res [k v]] (update res k grouping-fn (mapping-fn v)))
  {}
  coll))

(def foos [[:a "foo"]  [:b "bar"]  [:a "baz"]])

(mapping-group-by conj clojure.string/upper-case foos)
;;=> {:a ("BAZ" "FOO"), :b ("BAR")}

If you need vector values, you can wrap `conj` with `fnil` to get a vector.

(mapping-group-by (fnil conj []) clojure.string/upper-case foos)
;;=> {:a ["FOO" "BAZ"] :b ["BAR"]}

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


grouping and mapping

2016-08-14 Thread Nathan Smutz
Just to put the basic Clojure out there:

(->> (group-by first foos) 
 (map (fn [[key col]] 
  [key (mapv (comp clojure.string/upper-case second) 
 col)]))
 (into {})

Kudos to Moe,Christopher and Simon.

-- 
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] Automatic Clojure Type Annotations

2016-08-14 Thread Ambrose Bonnaire-Sergeant
Hi,

Happy to announce a new open-source Clojure tool
to generate core.typed type annotations from tests. It's part of a
new crowdfunding campaign

I'm running, read on for details!

# What is it?

This tool infers top-level annotations by instrumenting
your code, running tests, and finally inserts inferred
annotations directly in your source code.

Here's a quick gif

demonstrating
the tool.

You can read more about the ideas behind the tool here
.

# Prototype: Write Tests, Get Types!

The latest core.typed release contains a
prototype for Automatic Annotation inference.

Try it out here !

# Crowdfunding

I am running a crowdfunding campaign

to support
Automatic Annotations for Typed Clojure. The money
will help me keep working on Typed Clojure and travel
to industry conferences.

I will be writing more about how this tool works, and
the general applicability of the infrastructure its
based on.

For example:
- clojure.spec generative tests can help generate type annotations, and
- the infrastructure could even be repurposed to generate clojure.spec
specs!
- mutually recursive map structures can be inferred
- ideas for polymorphic inference

There are only 7 days left and we need $7,500 to
reach our goal. Please help by contributing!

Thanks for your support!
Ambrose

-- 
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: Multiple key-value pairs in assoc-in (old issue)

2016-08-14 Thread Łukasz Kożuchowski
I am a little sad now. Thanks for explaining!

Łukasz Kożuchowski

On Aug 13, 2016 4:56 PM, "Andy Fingerhut"  wrote:

> That ticket is in a state called "Triaged", which means that a screener
> (most likely Alex Miller) thinks the issue is good enough for Rich Hickey
> to take a look at it some time.  Rich probably hasn't looked at it yet,
> because if he had, it would have likely been changed to Declined or Vetted.
>
> As far as expectations go, there are enough other things being worked on
> for Clojure 1.9 that I would not bet any money this ticket will make it in
> to that version.  Disclaimer: I am only an observer in this, not a
> decision-maker.
>
> Andy
>
> On Sat, Aug 13, 2016 at 4:18 AM, Łukasz Kożuchowski <
> lukasz.kozuchow...@gmail.com> wrote:
>
>> Hello,
>>
>> Currently assoc-in does not support multiple key-value pairs the way
>> assoc does.
>>
>> user=> (assoc {} :a 1 :b 2)
>> {:b 2, :a 1}
>> user=> (assoc-in {} [:a :b] 1 [:c :d] 2)
>> ArityException Wrong number of args (5) passed to: core$assoc-in
>> clojure.lang.AFn.throwArity (AFn.java:437)
>>
>> It appears a patch for this has been ready for more than a year:
>> http://dev.clojure.org/jira/browse/CLJ-1771
>>
>> Can we expect this to work soon?
>>
>> --
>>   Łukasz Kożuchowski
>>
>> --
>> 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.
>>
>
> --
> 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.
>

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