Re: Do functions never get inlined by jvm?

2013-04-25 Thread David Nolen
primitive hinted fns will get inlined. You can also play the same kinds of games that Clojure does with definterface+deftype and fns that declare :inline metadata. If you don't want to learn the subtleties of Clojure performance tuning then you can always write your performance critical bits in

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Alice
Primitive hinted funtions seem to be not an exception. (defn my-inc ^long [^long l] (inc l)) (defn f1 [^long l] (inc l)) (defn f2 [^long l] (my-inc l)) (time (dotimes [n 1] (f1 1))) (time (dotimes [n 1] (f1 1))) (time (dotimes [n 1] (f1 1))) (time (dotimes [n 1]

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Ambrose Bonnaire-Sergeant
jvm.tools.analyzer is a nice tool for exploration in this area. I don't personally know all the subtleties here, but after some playing I managed to emit an unboxing function. I could tell from the AST. https://gist.github.com/frenchy64/5459989 Thanks, Ambrose On Thu, Apr 25, 2013 at 9:44 PM,

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Phil Hagelberg
Three repetitions is not nearly enough to get a feel for how hotspot optimizes functions when it detects they're in a tight loop. I don't know how javac works, but Clojure doesn't optimize much for cases where hotspot can do a much better job over time. -Phil -- -- You received this message

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Jonathan Fischer Friberg
javac works, but Clojure doesn't optimize much for cases where hotspot can do a much better job over time. -Phil -- -- 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

Re: Do functions never get inlined by jvm?

2013-04-25 Thread David Nolen
You have to be very careful with microbenchmarks like this. I recommend writing less trivial benchmarks. For example http://github.com/clojure/test.benchmark/blob/master/src/main/clojure/alioth/spectral_norm.clj This code demonstrates performance on par with plain Java. There are many other

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Alice
Found this blog post written by fogus: To provide this level of flexibility Clojure establishes a level of indirection. Specifically, all function lookups through a Var occur, at the lowest level, through an atomic volatile. This happens every time that a function bound using the def/defn special

Re: Do functions never get inlined by jvm?

2013-04-25 Thread David Nolen
Which is out of date. On Thu, Apr 25, 2013 at 12:47 PM, Alice dofflt...@gmail.com wrote: Found this blog post written by fogus: To provide this level of flexibility Clojure establishes a level of indirection. Specifically, all function lookups through a Var occur, at the lowest level,

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Alice
Care to elaborate which part is out of date? On Apr 26, 1:48 am, David Nolen dnolen.li...@gmail.com wrote: Which is out of date. On Thu, Apr 25, 2013 at 12:47 PM, Alice dofflt...@gmail.com wrote: Found this blog post written by fogus: To provide this level of flexibility Clojure

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Michael Klishin
2013/4/25 David Nolen dnolen.li...@gmail.com + :inline metadata Which is not documented anywhere and might as well not exist for regular Clojure users. -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- -- You received this message because you are subscribed to

Re: Do functions never get inlined by jvm?

2013-04-25 Thread David Nolen
(doc definline) On Thu, Apr 25, 2013 at 1:17 PM, Michael Klishin michael.s.klis...@gmail.com wrote: 2013/4/25 David Nolen dnolen.li...@gmail.com + :inline metadata Which is not documented anywhere and might as well not exist for regular Clojure users. -- MK

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Michael Klishin
to regular users (who have no idea about the compiler internals or JVM), you may want to reconsider. Also, if I don't know definline exists, how do I find out? Books, docs don't mention it. 1 page on clojure.org that you have to find doesn't count. -- MK http://github.com/michaelklishin http

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Softaddicts
. Cannot be used with variadic () args. If you think this is useful to regular users (who have no idea about the compiler internals or JVM), you may want to reconsider. Also, if I don't know definline exists, how do I find out? Books, docs don't mention it. 1 page on clojure.org that you

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Michael Klishin
2013/4/25 Softaddicts lprefonta...@softaddicts.ca user= (apropos inline) (definline) Yeah, yeah. It all starts with (apropos apropos), right? I knew it. -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- -- You received this message because you are subscribed to

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Softaddicts
You asked a simple question, you got a plain answer. Now if you are still grunting there's not much I can do about that. I do agree that the doc string could be a bit more descriptive. But what does it mean to be understandable by normal users ? I am still trying to size what is a normal Lisp

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Michael Klishin
2013/4/25 Softaddicts lprefonta...@softaddicts.ca Inlining is a concept that existed for more than 40 years in many programming languages. It's not anything new. The OP probably know what inlining is because, hm, the subject has that word. Then she is recommended to use something that only

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Gary Trakhman
are still grunting there's not much I can do about that. I do agree that the doc string could be a bit more descriptive. But what does it mean to be understandable by normal users ? I am still trying to size what is a normal Lisp user these days. No single answer seems to fit so far. When I first

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Softaddicts
Well you looked quite outraged that it could not be found easily. I demonstrated that doc strings can be easily searched. Of course my answer comes in total antagonism with your usual position about the bad state of the existing documentation which is incomplete, wrong, ... and so forth.

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Michael Klishin
2013/4/25 Softaddicts lprefonta...@softaddicts.ca Of course my answer comes in total antagonism with your usual position about the bad state of the existing documentation which is incomplete, wrong, ... and so forth. Your reaction does not suprise me, your behavior is quite predictable.

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Softaddicts
May I suggest you an upgrade ? http://www.ehow.com/how_6949396_record-78-vinyl-records-cd.html 2013/4/25 Softaddicts lprefonta...@softaddicts.ca Of course my answer comes in total antagonism with your usual position about the bad state of the existing documentation which is incomplete,

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Gary Trakhman
Good vinyls are considered higher quality by audiophiles, because there are less stages in between the mastering and amplification. There is more potential of better performance. It can be considered a real-world case of inlining. On Thu, Apr 25, 2013 at 3:16 PM, Softaddicts

Re: Do functions never get inlined by jvm?

2013-04-25 Thread Michael Klishin
2013/4/25 Softaddicts lprefonta...@softaddicts.ca May I suggest you an upgrade ? http://www.ehow.com/how_6949396_record-78-vinyl-records-cd.html Ah, a batch of fresh preaching from Mr. Defend Clojure/core At All Costs. Best Canadian export since Wayne Gretzky! -- MK

Re: Do functions never get inlined by jvm?

2013-04-25 Thread gaz jones
There seems to be some rule that given sufficient time and enough participants, all threads deteriorate into an argument about the current state of clojure documentation and a huge post from Tim Daly regarding literate programming in 3...2...1... On Thu, Apr 25, 2013 at 2:23 PM, Gary Trakhman

Re: Do functions never get inlined by jvm?

2013-04-25 Thread u1204
...0? :-) Tim Daly -- -- 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

Do you know which language the clojure is written by?

2013-04-22 Thread ljcppunix
Hi, Do you know which language the clojure is written by? -- -- 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

Re: Do you know which language the clojure is written by?

2013-04-22 Thread dennis zhuang
Java. But there is some clojure version written in ruby,python,c# and javascript. 2013/4/22 ljcppu...@gmail.com Hi, Do you know which language the clojure is written by? -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group

Re: Do you know which language the clojure is written by?

2013-04-22 Thread Michael Klishin
2013/4/22 dennis zhuang killme2...@gmail.com But there is some clojure version written in ruby,python,c# and javascript. ClojureScript compiler is not implemented in JavaScript, it emits JavaScript but implemented in Clojure. Hopefully will be self-hosted one day! -- MK

Something goofy you can do in Clojure.

2013-04-09 Thread Cedric Greevey
This may look mildly surprising, and suggests one more thing *not* to ever do in production code: user= (+ .3 1.7) 2.1 user= :) Shouldn't be hard to figure out how to put a repl in a state where that expression will evaluate to that result. I'm sure mathematicians everywhere are deeply offended

Re: Something goofy you can do in Clojure.

2013-04-09 Thread Mark Engelberg
do in production code: user= (+ .3 1.7) 2.1 user= :) Shouldn't be hard to figure out how to put a repl in a state where that expression will evaluate to that result. I'm sure mathematicians everywhere are deeply offended by the clojure reader now. :) -- -- You received this message

Re: Something goofy you can do in Clojure.

2013-04-09 Thread Jim foo.bar
: = (+ 0.3M 1.7M) 2.0M On Tue, Apr 9, 2013 at 1:53 AM, Cedric Greevey cgree...@gmail.com mailto:cgree...@gmail.com wrote: This may look mildly surprising, and suggests one more thing *not* to ever do in production code: user= (+ .3 1.7) 2.1 user= :) Shouldn't be hard

Re: Something goofy you can do in Clojure.

2013-04-09 Thread Niels van Klaveren
In Clojure 1.5.1: = (+ .3 1.7) CompilerException java.lang.RuntimeException: Unable to resolve symbol: .3 in this context, compiling:(NO_SOURCE_PATH:1:1) So the only way you can do this is if you def'd .3 before = (def .3 0.4) = (+ .3 1.7) 2.1 On Tuesday, April 9, 2013 10:53:06 AM UTC+2

Re: Something goofy you can do in Clojure.

2013-04-09 Thread Gary Verhaegen
) CompilerException java.lang.RuntimeException: Unable to resolve symbol: .3 in this context, compiling:(NO_SOURCE_PATH:1:1) So the only way you can do this is if you def'd .3 before = (def .3 0.4) = (+ .3 1.7) 2.1 On Tuesday, April 9, 2013 10:53:06 AM UTC+2, Cedric Greevey wrote: This may look

Re: Something goofy you can do in Clojure.

2013-04-09 Thread Mark Engelberg
point representations of numbers are inexact. That's why, if you care about exactness, you should write: = (+ 0.3M 1.7M) 2.0M On Tue, Apr 9, 2013 at 1:53 AM, Cedric Greevey cgree...@gmail.com wrote: This may look mildly surprising, and suggests one more thing *not* to ever do

Re: IMPORTANT: For Potential GSoC 2012 mentors, do this now please!

2013-04-09 Thread Mikera
...@hagelb.orgjavascript: wrote: On Mon, Apr 9, 2012 at 7:17 AM, David Nolen dnolen...@gmail.comjavascript: wrote: Yes apply to be a mentor - sorry it wasn't more clear - this could have been done at anytime. Also important DO NOT associate yourself with a proposal in Confluence - you

Re: IMPORTANT: For Potential GSoC 2012 mentors, do this now please!

2013-04-09 Thread Daniel Solano Gómez
, 2012 at 12:52 PM, Phil Hagelberg ph...@hagelb.orgjavascript: wrote: On Mon, Apr 9, 2012 at 7:17 AM, David Nolen dnolen...@gmail.comjavascript: wrote: Yes apply to be a mentor - sorry it wasn't more clear - this could have been done at anytime. Also important DO

Re: If there is no nil values, why do I get null pointer exception?

2013-03-22 Thread Gary Verhaegen
I would guess the NPE comes from the form (xml/emit-str (xml/map-Element next-movie-as-map)), given that (conj nil nil) does not throw. Perhaps try to isolate the problem in a smaller chunk of code, and then file a bug with the data.xml library? On 21 March 2013 19:16, larry google groups

Re: If there is no nil values, why do I get null pointer exception?

2013-03-22 Thread larry google groups
into the sea. In the comparative safety of Tokyo, two wives and a child living in the same apartment building have nothing to do but wait for their husbands\u2019 return. Nobuteru Uchida finds a striking emotional core to the shock of March 11, 2011, crafting a tender and intelligent narrative

Re: If there is no nil values, why do I get null pointer exception?

2013-03-22 Thread larry google groups
of the ensuing tsunami finally rolling back into the sea. In the comparative safety of Tokyo, two wives and a child living in the same apartment building have nothing to do but wait for their husbands\u2019 return. Nobuteru Uchida finds a striking emotional core to the shock of March 11

If there is no nil values, why do I get null pointer exception?

2013-03-21 Thread larry google groups
I am getting a null pointer exception in the line where I conj into the vector. I added the pprint so I could see what was going on. I am confused by the outcome: (defn convert-json-to-xml [json-as-flat-maps] (reduce (fn [vector-of-strings next-movie-as-map] (println next move as

Re: how do I find an IO exception triggering retries in clj-http?

2013-03-05 Thread larry google groups
have wrapped it in a try+ / catch Object o block. And I print the o to the terminal, and yet I am not seeing anything in the terminal. So where is the IOException? How do I find it? This is the actual function I use to ping the Omniture API: (defn omniture-call-api [url-with-queue-method

Re: how do I find an IO exception triggering retries in clj-http?

2013-03-05 Thread larry google groups
have wrapped it in a try+ / catch Object o block. And I print the o to the terminal, and yet I am not seeing anything in the terminal. So where is the IOException? How do I find it? This is the actual function I use to ping the Omniture API: (defn omniture-call-api [url-with-queue

Re: how do I find an IO exception triggering retries in clj-http?

2013-03-05 Thread Meikel Brandmeyer (kotarak)
Hi, silly question are you using the call in a sequence pipeline with pmap or mapcat or the like? Or does clj-http that under the covers? 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

Re: how do I find an IO exception triggering retries in clj-http?

2013-03-05 Thread larry google groups
the call to Omniture as one of the first things it does on startup. I will dig into clj-http to see what it is doing under the covers. I am curious, do you have a suspicion about something? A theory? On Mar 5, 11:17 am, Meikel Brandmeyer (kotarak) m...@kotka.de wrote: Hi, silly question

Re: how do I find an IO exception triggering retries in clj-http?

2013-03-05 Thread larry google groups
This is strange. An IOException is thrown, but it seems to do with with the retry, which should never exist in the first place, unless an IOException has been thrown: clj-http has thrown this exception: {:trace-redirects [https://api2.omniture.com/admin/1.3/rest/? method=Report.QueueOvertime

Re: how do I find an IO exception triggering retries in clj-http?

2013-03-05 Thread larry google groups
will have to come back to this later, when I have more time, and try to figure out what is going wrong. On Mar 5, 2:19 pm, larry google groups lawrencecloj...@gmail.com wrote: This is strange. An IOException is thrown, but it seems to do with with the retry, which should never exist in the first

Re: how do I find an IO exception triggering retries in clj-http?

2013-03-05 Thread larry google groups
lawrencecloj...@gmail.com wrote: This is strange. An IOException is thrown, but it seems to do with with the retry, which should never exist in the first place, unless an IOException has been thrown:  clj-http has thrown this exception: {:trace-redirects  [https://api2

why do I get Null pointer on this GMT SimpleDateFormat?

2013-03-04 Thread larry google groups
I need to get a GMT date. I found this page on StackOverflow: http://stackoverflow.com/questions/308683/how-can-i-get-the-current-date-and-time-in-utc-or-gmt-in-java It gives this example: SimpleDateFormat dateFormatGmt = new SimpleDateFormat(-MMM-dd HH:mm:ss);

Re: why do I get Null pointer on this GMT SimpleDateFormat?

2013-03-04 Thread Ray Miller
You've assigned to date-formatter-set-to-gmt-time the return value from the setTimeZone method call. This method returns null, hence the null pointer exception when you try to call the format method. 'doto' might help here, like: (let [gmt-date-formatter (doto (SimpleDateFormat. -MMM-dd

Re: why do I get Null pointer on this GMT SimpleDateFormat?

2013-03-04 Thread larry google groups
Thank you. That is very helpful. On Mar 4, 3:17 pm, Ray Miller r...@1729.org.uk wrote: You've assigned to date-formatter-set-to-gmt-time the return value from the setTimeZone method call. This method returns null, hence the null pointer exception when you try to call the format method. 'doto'

how do I find an IO exception triggering retries in clj-http?

2013-03-04 Thread larry google groups
a successful response on the first try, so what would the IOException be? Because clj-http uses Slingshot, I have wrapped it in a try+ / catch Object o block. And I print the o to the terminal, and yet I am not seeing anything in the terminal. So where is the IOException? How do I find

Re: how do I find an IO exception triggering retries in clj-http?

2013-03-04 Thread Marc Boschma
, I have wrapped it in a try+ / catch Object o block. And I print the o to the terminal, and yet I am not seeing anything in the terminal. So where is the IOException? How do I find it? This is the actual function I use to ping the Omniture API: (defn omniture-call-api [url-with-queue-method

Why is java.io/do-copy defined private

2013-02-22 Thread Jürgen Hötzel
Hi, I implemented (defmethod (var-get #'io/do-copy) [Path Path] [#^Path input #^Path output opts] ...) for fast NIO2 io, but had to do the var-get workaround because do-copy is defined private. Jürgen -- -- You received this message because you are subscribed to the Google Groups

how do I include a single class file from someone else's library?

2013-02-22 Thread larry google groups
I am ignorant of the JVM, and of Java, so I am sure this is a dumb question. I need to post to the Omniture API. They offer some sample code here: https://developer.omniture.com/en_US/blog/calling-rest-api-in-java That code depends on a Base64Coder class which they offer in a zip file. I

Re: how do I include a single class file from someone else's library?

2013-02-22 Thread larry google groups
When I just do something obvious, like in mpdv.core: (ns mpdv.core (:gen-class) (:import (Base64Coder)) and then call its static methods I get: Exception in thread main java.lang.NoClassDefFoundError: Base64Coder (wrong name: com/omniture/security/Base64Coder), compiling:(mpdv

Re: Why is java.io/do-copy defined private

2013-02-22 Thread Stuart Sierra
Hi Jürgen, Things are declared :private usually because the author of the library didn't want to commit to a public API function in future releases. The var-get trick works fine (you can also write @#'io/do-copy) but there's no promise that `do-copy` will stay the same between releases

Re: how do I include a single class file from someone else's library?

2013-02-22 Thread larry google groups
Ah, I see. This is a polygot project, which Leiningen describes here: https://github.com/technomancy/leiningen/blob/stable/doc/MIXED_PROJECTS.md That worked for me. Leiningen saves the day again. On Friday, February 22, 2013 4:25:04 PM UTC-5, larry google groups wrote: When I just do

Re: how do I include a single class file from someone else's library?

2013-02-22 Thread larry google groups
Maybe I spoke too soon. I have now stepped into the Twilight Zone. Changes I make to files do not get built when a try to run lein. Just to get some kind of reaction from Leinengen I just put random garbage in the ns clause of my core.clj: (ns lkjlkljlkjlkj mpdv.core (:gen-class

Re: how do I include a single class file from someone else's library?

2013-02-22 Thread larry google groups
too soon. I have now stepped into the Twilight Zone. Changes I make to files do not get built when a try to run lein. Just to get some kind of reaction from Leinengen I just put random garbage in the ns clause of my core.clj: (ns lkjlkljlkjlkj mpdv.core (:gen-class) (:import

Re: how do I include a single class file from someone else's library?

2013-02-22 Thread larry google groups
, 2013 5:23:28 PM UTC-5, larry google groups wrote: Maybe I spoke too soon. I have now stepped into the Twilight Zone. Changes I make to files do not get built when a try to run lein. Just to get some kind of reaction from Leinengen I just put random garbage in the ns clause of my core.clj

Re: how do I include a single class file from someone else's library?

2013-02-22 Thread Marko Topolnik
obscure problems. but I have: src/ java/ mpdv/ Which I assume is what Leinengen is asking for. On Friday, February 22, 2013 5:23:28 PM UTC-5, larry google groups wrote: Maybe I spoke too soon. I have now stepped into the Twilight Zone. Changes I make to files do not get built when

Re: how do I include a single class file from someone else's library?

2013-02-22 Thread larry google groups
is what Leinengen is asking for. On Friday, February 22, 2013 5:23:28 PM UTC-5, larry google groups wrote: Maybe I spoke too soon. I have now stepped into the Twilight Zone. Changes I make to files do not get built when a try to run lein. Just to get some kind of reaction from Leinengen I just

Re: how do I include a single class file from someone else's library?

2013-02-22 Thread AtKaaZ
into the Twilight Zone. Changes I make to files do not get built when a try to run lein. Just to get some kind of reaction from Leinengen I just put random garbage in the ns clause of my core.clj: (ns lkjlkljlkjlkj mpdv.core (:gen-class) (:import (java.net URL URLConnection

Re: how do I include a single class file from someone else's library?

2013-02-22 Thread larry google groups
/ Which I assume is what Leinengen is asking for. On Friday, February 22, 2013 5:23:28 PM UTC-5, larry google groups wrote: Maybe I spoke too soon. I have now stepped into the Twilight Zone. Changes I make to files do not get built when a try to run lein. Just to get some kind of reaction

Re: how do I include a single class file from someone else's library?

2013-02-22 Thread larry google groups
problems. but I have: src/ java/ mpdv/ Which I assume is what Leinengen is asking for. On Friday, February 22, 2013 5:23:28 PM UTC-5, larry google groups wrote: Maybe I spoke too soon. I have now stepped into the Twilight Zone. Changes I make to files do not get built when

Re: how do I include a single class file from someone else's library?

2013-02-22 Thread Marko Topolnik
. but I have: src/ java/ mpdv/ Which I assume is what Leinengen is asking for. On Friday, February 22, 2013 5:23:28 PM UTC-5, larry google groups wrote: Maybe I spoke too soon. I have now stepped into the Twilight Zone. Changes I make to files do not get built when a try to run

Re: how do I include a single class file from someone else's library?

2013-02-22 Thread larry google groups
/ Which I assume is what Leinengen is asking for. On Friday, February 22, 2013 5:23:28 PM UTC-5, larry google groups wrote: Maybe I spoke too soon. I have now stepped into the Twilight Zone. Changes I make to files do not get built when a try to run lein. Just to get some kind of reaction

how do I reference a var that is in my core namespace?

2013-02-21 Thread larry google groups
. When I println *ns* to the terminal output, I see the namespace is: #Namespace clojure.core Which surprises me somewhat. How do I get ns-resolve to look in mpdv.core for the var that I want it to find? -- -- You received this message because you are subscribed to the Google Groups

Re: how do I reference a var that is in my core namespace?

2013-02-21 Thread Sean Corfield
namespace is currently executing which is why it changes unexpectedly when you're trying to do something obvious with it. On Thu, Feb 21, 2013 at 10:30 AM, larry google groups lawrencecloj...@gmail.com wrote: I wanted to have some functions run when an app starts, and I wanted

Re: how do I reference a var that is in my core namespace?

2013-02-21 Thread larry google groups
That worked. I find it a little surprising that this is the correct way to do this, but it worked, so I am happy. Thank you. On Thursday, February 21, 2013 1:43:18 PM UTC-5, Sean Corfield wrote: I tend to have this at the top of most of my namespaces: (def ^:private my-ns *ns

How do you typecast and insert a Postgres enum value using Clojure JDBC?

2013-02-06 Thread James Thornton
/insert-record :product product-12345)) However, status is an enum so you can't insert it as a normal string without casting it to an enum: 'InStock'::product_status I know you can do it with a prepared statement, such as: INSERT INTO product (name, status) VALUES (?, ?::product_status

do background threads sometimes swallow exceptions?

2013-01-29 Thread larry google groups
posted the question to Stackoverflow: http://stackoverflow.com/questions/14564589/how-do-i-add-a-document-to-mongodb-with-monger-and-clojure But so far I have no answers. *I do realize that in Clojure there are no statements, but I assume my meaning was clear enough. -- -- You received

Re: do background threads sometimes swallow exceptions?

2013-01-29 Thread larry google groups
threads to terminate immediately. That is good to know. I have the top level function call wrapped in a try/catch block, but I suppose I'll get better results if I do more of the try/catch at a lower level, closer to the problem. W dniu wtorek, 29 stycznia 2013 16:03:51 UTC-5 użytkownik Michael

Re: do background threads sometimes swallow exceptions?

2013-01-29 Thread Chas Emerick
On Jan 29, 2013, at 4:56 PM, Michael Klishin wrote: 2013/1/30 larry google groups lawrencecloj...@gmail.com That is good to know. I have the top level function call wrapped in a try/catch block, but I suppose I'll get better results if I do more of the try/catch at a lower level, closer

How do I install guice?

2013-01-14 Thread larry google groups
I am building a web app. I just included Compojure and Friend as dependencies, and one of these, in turn, relies on Google Guice. I type: lein uberjar and I get a whole lot of output which includes: Could not find artifact com.google.code.guice:guice:pom:2.0 in central

Re: How do I install guice?

2013-01-14 Thread Chas Emerick
Please change your Friend dependency to [com.cemerick/friend 0.1.3]. Prior versions transitively depended upon a Guice artifact that was hosted on a now-404 Maven repository via Google Code's svn. Friend = 0.1.3 depends only on artifacts available in Clojars and Maven Central, and will remain

Re: How do I install guice?

2013-01-14 Thread larry google groups
Thank you for the fast reply. That helped. But do you (or anyone else here) know of a workaround for friend-oauth2? I get: lein uberjar Could not find artifact friend-oauth2:friend-oauth2:pom:0.0.2 in central (http://repo1.maven.org/maven2) Retrieving friend-oauth2/friend-oauth2/0.0.2/friend

Re: How do I install guice?

2013-01-14 Thread Chas Emerick
, 2013, at 11:48 AM, larry google groups wrote: Thank you for the fast reply. That helped. But do you (or anyone else here) know of a workaround for friend-oauth2? I get: lein uberjar Could not find artifact friend-oauth2:friend-oauth2:pom:0.0.2 in central (http://repo1.maven.org/maven2

Re: what Jetty jars do I need for WebSockets?

2012-12-10 Thread larry google groups
Thank you. I will do that. I find that trying to learn both Clojure and the JVM (which automatically entails parts of the Java eco-system), is a little overwhelming at first. But I suppose that is true of learning anything new. On Sunday, December 9, 2012 9:04:44 PM UTC-5, Jay Fields wrote

Re: what Jetty jars do I need for WebSockets?

2012-12-10 Thread Jay Fields
The upside of using Java is that it's very widely documented. Also, I find people on this mailing list to be very helpful. Nonetheless, I'm sure it's frustrating to have to learn about Java when you just want to do some Clojure. I've previously written about using Webbit with Clojure: http

what Jetty jars do I need for WebSockets?

2012-12-09 Thread larry google groups
I am still fairly new to Clojure, the JVM and Java, so I get lost trying to read some of the stuff that assumes knowledge of any of those 3. I want to build a Clojure app using Jetty and offering WebSocket connections. I have already built an app with Clojure and Jetty, so that part is easy.

Re: what Jetty jars do I need for WebSockets?

2012-12-09 Thread Jay Fields
I don't have the answer, but I would strongly recommend webbit: https://github.com/webbit/webbit I've been using it for quite awhile and I've been very happy with it. On Sun, Dec 9, 2012 at 8:55 PM, larry google groups lawrencecloj...@gmail.com wrote: I am still fairly new to Clojure, the JVM

How do ClojureScript protocol functions work?

2012-10-07 Thread Timothy Baldridge
While digging through the CLJS sources I've seen that protocols use some sort of odd bitmask optimization. Is this documented anywhere? Or as a more general question, is the way protocols are implemented in CLJS documented at all? Thanks, Timothy -- You received this message because you are

Re: how do I evaluate this lazy sequence?

2012-09-29 Thread larry google groups
'assoc' it will return you a new map with the new values assoc'd. It will not mutate the original, so: (let [foo {}]    (assoc foo :a 1)    (assoc foo :b 2)    foo) Will return {}. You need to do something like: (- {}       (assoc :a 1)       (assoc :b 2)) = {:a 1 :b 2} FYI

Questions regarding do form

2012-09-27 Thread arekanderu
Hello all, I am new to clojure and I have two questions about do and the way it should be used. *Question 1: Which of the following two functions is more idiomatic and why? Both functions produce the same result.* code (defn my-fn [java-object] (. java-object firstFunc) (. java-object

Re: Questions regarding do form

2012-09-27 Thread Meikel Brandmeyer (kotarak)
Hi, Am Donnerstag, 27. September 2012 12:16:41 UTC+2 schrieb arekanderu: I am new to clojure and I have two questions about do and the way it should be used. *Question 1: Which of the following two functions is more idiomatic and why? Both functions produce the same result.* code (defn

Re: Questions regarding do form

2012-09-27 Thread arekanderu
Thank you Meikel for your so helpful replies. On Thursday, September 27, 2012 4:19:44 PM UTC+3, Meikel Brandmeyer (kotarak) wrote: Hi, Am Donnerstag, 27. September 2012 12:16:41 UTC+2 schrieb arekanderu: I am new to clojure and I have two questions about do and the way it should be used

Re: Questions regarding do form

2012-09-27 Thread Russell Whitaker
Brandmeyer (kotarak) wrote: Hi, Am Donnerstag, 27. September 2012 12:16:41 UTC+2 schrieb arekanderu: I am new to clojure and I have two questions about do and the way it should be used. Question 1: Which of the following two functions is more idiomatic and why? Both functions produce the same

Re: Questions regarding do form

2012-09-27 Thread Grant Rettke
: I am new to clojure and I have two questions about do and the way it should be used. Question 1: Which of the following two functions is more idiomatic and why? Both functions produce the same result. code (defn my-fn [java-object] (. java-object firstFunc) (. java-object secondFunc

Re: Questions regarding do form

2012-09-27 Thread Wes Freeman
, 27. September 2012 12:16:41 UTC+2 schrieb arekanderu: I am new to clojure and I have two questions about do and the way it should be used. Question 1: Which of the following two functions is more idiomatic and why? Both functions produce the same result. code (defn my-fn [java

how do I evaluate this lazy sequence?

2012-09-27 Thread larry google groups
)) final-map-for-output))) @registry))) The various variations I have tried on this have either given me a blank white page or: {} Nothing else. I used to do simply: (response (apply str (doall @registry) This worked fine. But it did not output

Re: how do I evaluate this lazy sequence?

2012-09-27 Thread Tassilo Horn
. But I still can not get anything to work: Your problem's here and has nothing to do with lazyness: (let [inner-details (second each-user-map)] (assoc final-map-for-output username (get inner-details username nothing found for user)) (assoc final-map

Re: how do I evaluate this lazy sequence?

2012-09-27 Thread gaz jones
Couple of initial things, Clojure has immutable data structures so when you call for example 'assoc' it will return you a new map with the new values assoc'd. It will not mutate the original, so: (let [foo {}] (assoc foo :a 1) (assoc foo :b 2) foo) Will return {}. You need to do something

Re: how do I evaluate this lazy sequence?

2012-09-27 Thread Jim - FooBar();
of initial things, Clojure has immutable data structures so when you call for example 'assoc' it will return you a new map with the new values assoc'd. It will not mutate the original, so: (let [foo {}] (assoc foo :a 1) (assoc foo :b 2) foo) Will return {}. You need to do something like

Re: how do we go about promoting new clojure libraries?

2012-09-26 Thread Stuart Sierra
http://dev.clojure.org/display/community/Libraries is unorganized and out of date - volunteers welcome. James Reeves created http://www.clojure-toolbox.com/ -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: how do we go about promoting new clojure libraries?

2012-09-26 Thread Mayank Jain
On Thu, Sep 27, 2012 at 12:31 AM, Stuart Sierra the.stuart.sie...@gmail.com wrote: http://dev.clojure.org/display/community/Libraries is unorganized and out of date - volunteers welcome. I am interested in keeping the clojure libraries up to date. Can you give me some ideas what are the

Re: how do we go about promoting new clojure libraries?

2012-09-26 Thread Stuart Sierra
On Wednesday, September 26, 2012 3:05:08 PM UTC-4, Mayank Jain wrote: I am interested in keeping the clojure libraries up to date. Can you give me some ideas what are the tasks that needs to be done? So that I have some idea about it. 1. Send in a signed Clojure Contributor Agreement:

Re: how do we go about promoting new clojure libraries?

2012-09-26 Thread Mayank Jain
@Stuart Thanks. But it says Send your signed agreement via postal mail to: Do I need to send it via postal mail? (I stay in India) On Thu, Sep 27, 2012 at 12:38 AM, Stuart Sierra the.stuart.sie...@gmail.com wrote: On Wednesday, September 26, 2012 3:05:08 PM UTC-4, Mayank Jain wrote: I am

Re: how do we go about promoting new clojure libraries?

2012-09-26 Thread Michael Klishin
2012/9/26 Mayank Jain firesof...@gmail.com Thanks. But it says Send your signed agreement via postal mail to: Do I need to send it via postal mail? (I stay in India) Unfortunately, yes. Clojure uses a fine crafted 16th century contributor agreement process that does not take into account

Re: how do we go about promoting new clojure libraries?

2012-09-26 Thread Michael Klishin
2012/9/26 Stuart Sierra the.stuart.sie...@gmail.com http://dev.clojure.org/display/community/Libraries is unorganized and out of date - volunteers welcome. Stuart, No, that's not how it works. You *first* make contribution process easy, *then* ask people to volunteer. Not the other way

Re: how do we go about promoting new clojure libraries?

2012-09-26 Thread Baishampayan Ghose
On Wed, Sep 26, 2012 at 12:35 PM, Michael Klishin michael.s.klis...@gmail.com wrote: Unfortunately, yes. Clojure uses a fine crafted 16th century contributor agreement process that does not take into account that there may be potential contributors outside of North America and western Europe.

<    4   5   6   7   8   9   10   11   12   13   >