Re: browser lisp editor

2014-04-21 Thread Bruce Wang
Hi Brian,

Try Ace (https://github.com/ajaxorg/ace) it has both Clojure and Lisp mode,
should be enough for your requirements.

Cheers,
Bruce


On Tue, Apr 22, 2014 at 2:30 PM, Brian Craft  wrote:

> Slightly off topic.
>
> Anyone know of a simple browser-based lisp editor that can be embedded in
> a page? Indenting & matching parens would be sufficient. I don't need
> evaluation.
>
> --
> 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 is good
http://brucewang.net
http://twitter.com/number5

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


browser lisp editor

2014-04-21 Thread Brian Craft
Slightly off topic.

Anyone know of a simple browser-based lisp editor that can be embedded in a 
page? Indenting & matching parens would be sufficient. I don't need 
evaluation.

-- 
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: puzzled by RuntimeException

2014-04-21 Thread Greg D

Steve,

Thanks.  I did a quick check, and it seems that I don't get exceptions when 
I start the repl as you do.

I normally start mine with 'lein repl'.  You've given me a good lead to 
investigate.

Greg

-- 
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: Clojure source releases issue for Maven Central

2014-04-21 Thread Jeff Valk
Thanks, Alex.


On Monday, April 21, 2014 4:30:09 PM UTC-4, Alex Miller wrote:
>
> Seems to have been fixed only for snapshots; reopened.
>
>

-- 
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: puzzled by RuntimeException

2014-04-21 Thread Stephen Gilardi

> The sequence in the transcript below shows runtime exceptions when a numeric 
> keyword is followed by a list starting with a symbol or character.
> 
> Would anyone help me with a reason for the failing cases?
> 
> user=> (clojure-version)
> "1.6.0"
> user=> '(:42 a)
> (:42 a)
> user=> '(:42 "a")
> (:42 "a")
> user=> '(:42 \a)
> (:42 \a)
> user=> '(:42 nil)
> (:42 nil)
> user=> '(:42 true)
> (:42 true)
> user=> '(:42 :43)
> (:42 :43)
> user=> '(:42 (a))
> 
> RuntimeException EOF while reading, starting at line 1  
> clojure.lang.Util.runtimeException (Util.java:221)
> 
> RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException 
> (Util.java:221)
> user=> '(:42 ("a"))
> (:42 ("a"))
> user=> '(:42 (\a))

I tried to duplicate this result with the clojure.main repl, but was unable to 
do so. All entries in your post read in without raising an exception.

I used this command line to launch the repl:

% java -cp ~/.m2/repository/org/clojure/clojure/1.6.0/clojure-1.6.0.jar 
clojure.main

--Steve

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


puzzled by RuntimeException

2014-04-21 Thread Greg D
The sequence in the transcript below shows runtime exceptions when a 
numeric keyword is followed by a list starting with a symbol or character.

Would anyone help me with a reason for the failing cases?

user=> (clojure-version)
"1.6.0"
user=> '(:42 a)
(:42 a)
user=> '(:42 "a")
(:42 "a")
user=> '(:42 \a)
(:42 \a)
user=> '(:42 nil)
(:42 nil)
user=> '(:42 true)
(:42 true)
user=> '(:42 :43)
(:42 :43)
user=> '(:42 (a))

RuntimeException EOF while reading, starting at line 1  
clojure.lang.Util.runtimeException (Util.java:221)

RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException 
(Util.java:221)
user=> '(:42 ("a"))
(:42 ("a"))
user=> '(:42 (\a))

RuntimeException EOF while reading, starting at line 1  
clojure.lang.Util.runtimeException (Util.java:221)
RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException 
(Util.java:221)

user=> '(:42 (nil))

RuntimeException EOF while reading, starting at line 1  
clojure.lang.Util.runtimeException (Util.java:221)

user=> RuntimeException Unmatched delimiter: )  
clojure.lang.Util.runtimeException (Util.java:221)


user=> '(:42 (true))

RuntimeException EOF while reading, starting at line 1  
clojure.lang.Util.runtimeException (Util.java:221)

user=> RuntimeException Unmatched delimiter: )  
clojure.lang.Util.runtimeException (Util.java:221)


user=> '(:42 (:43))
(:42 (:43))
user=> 

-- 
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] immutable-int-map

2014-04-21 Thread Plínio Balduino
Got it. Awesome.

Good job, Zach


On Mon, Apr 21, 2014 at 1:52 AM, Zach Tellman  wrote:

> I could represent the map {0 :foo, 100 :bar} as an array, but it would
> have to be a million element array with a lot of empty space. This would be
> (maybe) faster w.r.t. lookups, but would be vastly slower for enumerating
> entries, merging other maps, and adding keys that are larger than the
> boundaries of the underlying array.  This data structure, which is
> described by the paper linked in the readme,  I also mention the
> possibility of using this to represent a sparse vector (as opposed to the
> array, which is dense) in the readme.
>
> Hope that answers your question,
> Zach
>
> On Sunday, April 20, 2014 9:44:21 PM UTC-7, Plinio Balduino wrote:
>>
>> "it's an immutable map that can only have positive integers as keys" -- Like
>> an array?
>>
>> (My question is child of my complete ignorance, and I'm not questioning
>> your knowledge or motivation)
>>
>> Plínio
>>
>>
>> On Mon, Apr 21, 2014 at 1:40 AM, Zach Tellman  wrote:
>>
>>> This one's pretty simple: it's an immutable map that can only have
>>> positive integers as keys.  It can be found at
>>> https://github.com/ztellman/immutable-int-map.
>>>
>>> The one interesting aspect of this is that it has an efficient merge
>>> mechanism, which means it plays better with Clojure's reducer framework
>>> than Clojure's own data structures.  This was a non-obvious consequence to
>>> me before I started working on it, so I figure others might also find it
>>> interesting.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@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+u...@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+u...@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.


clojurescript sandboxed code execution

2014-04-21 Thread t x
Hi,

  1) I'm writing code in Clojurescript.

  2) I want to have some level of user customizibility (i.e. think elisp)

  3) I want this to be sandboxed. (i.e. not full javascript)

  4) How do I do this in cljs, given I don't have eval?

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: Clojure source releases issue for Maven Central

2014-04-21 Thread Alex Miller
Seems to have been fixed only for snapshots; reopened.

On Thursday, April 17, 2014 11:51:31 AM UTC-5, Jeff Valk wrote:
>
> Current builds of the Clojure "sources" jar (clojure-1.6.0-sources.jar, 
> clojure-1.5.1-sources.jar, etc) available from the Maven Central "releases" 
> repository contain the errant "versions.properties" file noted in issue 
> CLJ-1161 [1] . The fix for that issue can be seen in the Central repo 
> labelled "clojure-1239" (staging?), but not in "releases":
>
> OK:  clojure-1239  001918a4c1e544a66d4bc6c84429694d  
> clojure-1.6.0-sources.jar [2]
> Bad: releases  1c03eec13fbd86083230c3e97ea5bab7  
> clojure-1.6.0-sources.jar [3]
>
> Could someone who is more familiar with the Clojure build/upload process 
> shed some light on this?
>
> Cheers,
> Jeff
>
>
> [1] http://dev.clojure.org/jira/browse/CLJ-1161
> [2] 
> https://oss.sonatype.org/index.html#view-repositories;orgclojure-1239~browsestorage~/org/clojure/clojure/1.6.0/clojure-1.6.0-sources.jar
> [3] 
> https://oss.sonatype.org/index.html#view-repositories;releases~browsestorage~/org/clojure/clojure/1.6.0/clojure-1.6.0-sources.jar
>
>

-- 
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: Why this Clojure part is working in Korma and no exception is thrown?

2014-04-21 Thread James Reeves
Try expanding out the expression. The macro starts with:

`(-> (~query-fn-var ~@args) ~@body)

Now plug in the values:

`(-> (#'insert* users) (values {:first "john" :last "doe"}))

Then expand the threading macro:

`(values (#'insert* users) {:first "john" :last "doe"})

So we end up with `values` taking two arguments, which is correct.

- James


On 21 April 2014 15:07, Hussein B.  wrote:

> Hi,
>
> I'm trying to study the source code of Korma project.
>
> (insert users
>   (values {:first "john" :last "doe"}))
>
>
> This will resolve to (defmacro insert) 
> https://github.com/korma/Korma/blob/master/src/korma/core.clj#L143
>
>
> Will call (defn- make-query-then-execute) 
> https://github.com/korma/Korma/blob/master/src/korma/core.clj#L109
>
>
> What I don't get is the following:
>
>
> `(let [query# (-> (~query-fn-var ~@args)
> ~@body)]
>
>
> (~query-fn-var ~@args) will generate a map that will be feed to (defn values) 
> which accepts two arguments.
>
> https://github.com/korma/Korma/blob/master/src/korma/core.clj#L280
>
>
> I expected that part to throw:
>
>
> CompilerException clojure.lang.ArityException: Wrong number of args (1) 
> passed to: core/values
>
> But it is not.
>
> Any ideas why it is working?
>
> Thanks for help and time.
>
>
>
>
>  --
> 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: Idiomatic Clojure for iterating all items of a map

2014-04-21 Thread Justin Smith
small correction: sometimes one does need to nest a for or doseq call, but 
not for the usual nested iteration case

On Monday, April 21, 2014 8:57:49 AM UTC-7, Justin Smith wrote:
>
> That doseq is a no-op, because str has no side effects and doseq always 
> returns nil. Also there is no need to nest doseq calls. for is much like 
> doseq except it actually returns the result.
>
> user> (for [lang (:langs langs)
> k (keys lang)]
>(str k "  " (k lang)))
> (":lang  Clojure" ":version  1.6" ":lang  Erlang" ":version  17")
>
>
> On Monday, April 21, 2014 8:32:51 AM UTC-7, Hussein B. wrote:
>>
>> Hi,
>>
>> For a data structure such as:
>>
>> (def langs {:langs [ {:lang "Clojure" :version 1.6}
>> {:lang "Erlang"  :version 17} ] } )
>>
>> How to iterate all the items of the maps?
>>
>> I tried this but it is too imperative to me:
>>
>> (doseq [lang (:langs langs)
>>   (doseq [k (keys lang)]
>> (str k "  " (k lang
>>
>> Thanks for help and time.
>>
>

-- 
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: Idiomatic Clojure for iterating all items of a map

2014-04-21 Thread Justin Smith
That doseq is a no-op, because str has no side effects and doseq always 
returns nil. Also there is no need to nest doseq calls. for is much like 
doseq except it actually returns the result.

user> (for [lang (:langs langs)
k (keys lang)]
   (str k "  " (k lang)))
(":lang  Clojure" ":version  1.6" ":lang  Erlang" ":version  17")


On Monday, April 21, 2014 8:32:51 AM UTC-7, Hussein B. wrote:
>
> Hi,
>
> For a data structure such as:
>
> (def langs {:langs [ {:lang "Clojure" :version 1.6}
> {:lang "Erlang"  :version 17} ] } )
>
> How to iterate all the items of the maps?
>
> I tried this but it is too imperative to me:
>
> (doseq [lang (:langs langs)
>   (doseq [k (keys lang)]
> (str k "  " (k lang
>
> Thanks for help and time.
>

-- 
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] immutable-int-map

2014-04-21 Thread Zach Tellman
Correct. I'll clarify that I mean 64 bit integers in the readme.
On Apr 21, 2014 5:26 AM, "Alex Miller"  wrote:

> Never mind, look like you mean integer in the generic sense and you are
> using longs, right?
>
> --
> 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/topic/clojure/0EysWMml6Ks/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.
>

-- 
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: Idiomatic Clojure for iterating all items of a map

2014-04-21 Thread Timothy Washington
You can simply call *seq* on your map, and get a sequence of all map
entries.

user> (seq {:a 1 :b 2 :c 3})
([:a 1] [:c 3] [:b 2])



Hth

Tim Washington
Interruptsoftware.com 


On Mon, Apr 21, 2014 at 11:32 AM, Hussein B.  wrote:

> Hi,
>
> For a data structure such as:
>
> (def langs {:langs [ {:lang "Clojure" :version 1.6}
> {:lang "Erlang"  :version 17} ] } )
>
> How to iterate all the items of the maps?
>
> I tried this but it is too imperative to me:
>
> (doseq [lang (:langs langs)
>   (doseq [k (keys lang)]
> (str k "  " (k lang
>
> Thanks for help and time.
>
> --
> 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: Idiomatic Clojure for iterating all items of a map

2014-04-21 Thread Moritz Ulrich
Really depends on that you want. First thing coming to my mind is:

(for [l (:langs langs)
  [k v] l]
  (str k " " v))

This will give you a flat lazy list of strings.

On Mon, Apr 21, 2014 at 5:32 PM, Hussein B.  wrote:
> Hi,
>
> For a data structure such as:
>
> (def langs {:langs [ {:lang "Clojure" :version 1.6}
> {:lang "Erlang"  :version 17} ] } )
>
> How to iterate all the items of the maps?
>
> I tried this but it is too imperative to me:
>
> (doseq [lang (:langs langs)
>   (doseq [k (keys lang)]
> (str k "  " (k lang
>
> Thanks for help and time.
>
> --
> 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.


Idiomatic Clojure for iterating all items of a map

2014-04-21 Thread Hussein B.
Hi,

For a data structure such as:

(def langs {:langs [ {:lang "Clojure" :version 1.6}
{:lang "Erlang"  :version 17} ] } )

How to iterate all the items of the maps?

I tried this but it is too imperative to me:

(doseq [lang (:langs langs)
  (doseq [k (keys lang)]
(str k "  " (k lang

Thanks for help and time.

-- 
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] play-clj 0.3.0

2014-04-21 Thread Zach Oakes
This is a new release of my game library, 
play-clj. 
I released 0.1.0 here three months ago, and a lot has changed since then. 
You can read through the release 
notes to 
see the details.

This latest version supports LibGDX 1.0, which was released yesterday. It 
also includes some initial support for 3D physics, which you can test out 
by cloning play-clj-examples  and 
running the minimal-3d-physics project.

I also released a new version of Nightcode , which 
is now at 0.3.3. It includes the new play-clj template and many other 
things that I don't remember adding but are probably improvements 
(otherwise why would I have added them?).

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


Why this Clojure part is working in Korma and no exception is thrown?

2014-04-21 Thread Hussein B.
Hi,

I'm trying to study the source code of Korma project.

(insert users
  (values {:first "john" :last "doe"}))


This will resolve to (defmacro insert) 
https://github.com/korma/Korma/blob/master/src/korma/core.clj#L143


Will call (defn- make-query-then-execute) 
https://github.com/korma/Korma/blob/master/src/korma/core.clj#L109


What I don't get is the following:


`(let [query# (-> (~query-fn-var ~@args)
~@body)]


(~query-fn-var ~@args) will generate a map that will be feed to (defn values) 
which accepts two arguments.

https://github.com/korma/Korma/blob/master/src/korma/core.clj#L280


I expected that part to throw:


CompilerException clojure.lang.ArityException: Wrong number of args (1) passed 
to: core/values

But it is not.

Any ideas why it is working?

Thanks for help and time.




-- 
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] immutable-int-map

2014-04-21 Thread Alex Miller
Never mind, look like you mean integer in the generic sense and you are using 
longs, right?  

-- 
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] immutable-int-map

2014-04-21 Thread Alex Miller
This is great stuff. Why not longs? Are you going for space savings? 

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