Thanks for the tip, Timmy. This is a very interesting Vector feature.
-- christian
On Tue, Jun 5, 2012 at 7:13 PM, Tim Visher wrote:
> On Tue, Jun 5, 2012 at 7:59 AM, Christian Guimaraes
> wrote:
> > I hava a list (a b c) and want to create a hashmap using the elements
> from
> > this list.
>
On Tue, Jun 5, 2012 at 7:59 AM, Christian Guimaraes
wrote:
> I hava a list (a b c) and want to create a hashmap using the elements from
> this list.
>
> The keys will be a sequential number, and the values will be the values from
> the previous list.
>
> 1. list:
> (a b c)
>
> 2. desired hashmap
And a completely different approach:
(into {} (map-indexed #(vector (inc %1) %2) ["a" "b" "c"]))
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 n
If I needed the range to be infinite I'd probably use: (zipmap (iterate inc
1) '(a b c))
On Tue, Jun 5, 2012 at 8:13 AM, Baishampayan Ghose wrote:
> Or: (zipmap (drop 1 (range)) '(a b c))
>
> :-)
>
> Regards,
> BG
>
> On Tue, Jun 5, 2012 at 5:33 PM, Ambrose Bonnaire-Sergeant
> wrote:
> > Or: (zi
Or: (zipmap (drop 1 (range)) '(a b c))
:-)
Regards,
BG
On Tue, Jun 5, 2012 at 5:33 PM, Ambrose Bonnaire-Sergeant
wrote:
> Or: (zipmap (map inc (range)) '(a b c))
>
> Thanks,
> Ambrose
>
>
> On Tue, Jun 5, 2012 at 8:02 PM, Jay Fields wrote:
>>
>> (zipmap (range 1 4) ["a" "b" "c"])
>>
>>
>> On T
Awesome...
I'm studying lists manipulation. Solidifying this concept. The basic in
Clojure, in my point of view.
Thanks again.
On Tue, Jun 5, 2012 at 1:03 PM, Ambrose Bonnaire-Sergeant <
abonnaireserge...@gmail.com> wrote:
> Or: (zipmap (map inc (range)) '(a b c))
>
> Thanks,
> Ambrose
>
>
> On
Or: (zipmap (map inc (range)) '(a b c))
Thanks,
Ambrose
On Tue, Jun 5, 2012 at 8:02 PM, Jay Fields wrote:
> (zipmap (range 1 4) ["a" "b" "c"])
>
>
> On Tue, Jun 5, 2012 at 7:59 AM, Christian Guimaraes <
> cguimaraes...@gmail.com> wrote:
>
>> Hello all,
>>
>> I'm studying a little bit of Clojure
Also, if you're looking to learn this kind of stuff, 4clojure.com is an
excellent resource.
On Tue, Jun 5, 2012 at 8:02 AM, Jay Fields wrote:
> (zipmap (range 1 4) ["a" "b" "c"])
>
>
> On Tue, Jun 5, 2012 at 7:59 AM, Christian Guimaraes <
> cguimaraes...@gmail.com> wrote:
>
>> Hello all,
>>
>> I
(zipmap (range 1 4) ["a" "b" "c"])
On Tue, Jun 5, 2012 at 7:59 AM, Christian Guimaraes wrote:
> Hello all,
>
> I'm studying a little bit of Clojure and facing a doubt here.
>
> I hava a list (a b c) and want to create a hashmap using the elements from
> this list.
>
> The keys will be a sequenti
Hello all,
I'm studying a little bit of Clojure and facing a doubt here.
I hava a list (a b c) and want to create a hashmap using the elements from
this list.
The keys will be a sequential number, and the values will be the values
from the previous list.
1. list:
(a b c)
2. desired hashmap:
10 matches
Mail list logo