Re: 请教一个问题

2013-06-12 Thread James Xu
Let me translate: Hi all, I am reading lein-ring's source code, and I find that the many functions(defn) uses the syntax quote(`), e.g. > (defn load-namespaces > [& syms] > `(require > ~@(for [s syms :when s] > `'~(if-let [ns (namespace s)] > (symbol ns) > s My intuition is that syntax q

请教一个问题

2013-06-12 Thread stream
Hi all 我在看 lein-ring插件源码时,发现很多 语法引用符号 ` 都用在defn里。 `(do ~(start-nrepl-expr project) ~(start-server-expr project)) (defn load-namespaces [& syms] `(require ~@(for [s syms :when s] `'~(if-let [ns (namespace s)] (symbol ns) s 我的直觉是这些最好是用在编译期的宏里。

Re: Local database recommendation?

2013-06-12 Thread Zack Maril
No. We have done nothing with laziness. If your graph doesn't change much, you could probably roll your own. If it is changing often, I'm not sure laziness would be such a good thing. One way of rolling your own could be going through and getting all the ids of the elements you want and then ma

Re: Local database recommendation?

2013-06-12 Thread Cedric Greevey
I have some additional questions about Titanium, as the documentation did not make these particular matters sufficiently clear: 1. Can query results take the form of a lazy sequence, one which will not result in an OOME if it's too large so long as the head is not held onto while it is consumed? E

Re: Making cryptograms, my first Clojure function. Feedback welcome.

2013-06-12 Thread Kelker Ryan
No problem. I re-wrote your latest version, so let me know what you think. tdsl.core> (defn make-crypto [] (let [char-range #(map char (range (int %1) (-> %2 int inc))) [l u d] (map char-r

Re: license of Javascript files generated by Clojurescript?

2013-06-12 Thread Evan Mezeske
On Wednesday, June 12, 2013 5:29:42 AM UTC-7, David Pollak wrote: > With all this being said, the only thing you have to worry about is if you > make a change to the ClojureScript compiler itself or another > Clojure-related library. Those are licensed under the EPL which requires > that you ma

Re: Making cryptograms, my first Clojure function. Feedback welcome.

2013-06-12 Thread Shannon Severance
Thank you all, I've learned something from each entry. My latest version, incorporating some of the changes suggested: (defn make-crypto [] (let [lower (map char (range (int \a) (inc (int \z upper (map char (range (int \A) (inc (int \Z digit (map char (range (int \0) (in

Re: license of Javascript files generated by Clojurescript?

2013-06-12 Thread Stefan Kamphausen
Hi, On Wednesday, June 12, 2013 2:29:42 PM UTC+2, David Pollak wrote: > > The license of the JavaScript generated by the ClojureScript compiler is > the license of the source code that was compiled. And that license may be > "my company owns it and it's proprietary and we're not licensing it to

Re: Clojure in production

2013-06-12 Thread Jose A. Ortega Ruiz
Hi Plinio, On Mon, Jun 10 2013, Plínio Balduino wrote: > Hi there > > I'm writing a talk about Clojure in the real world and I would like to > know, if possible, which companies are using Clojure for production or > to make internal tools. At BigML, our backend is written almost fully (99%) in

Re: A blocking lazy sequence populated by multiple worker threads

2013-06-12 Thread Jeff Palmucci
If you are looking for a more idiomatic solution, https://github.com/jpalmucci/clj-yield wraps a lazy sequence around a blocking queue. On May 30, 2013, at 11:58 AM, Artem Boytsov wrote: > Hello, Colin, > > I suspected I should turn to existing Java concurrency constructs. Thank you > very

Re: license of Javascript files generated by Clojurescript?

2013-06-12 Thread David Pollak
Unless one of the folks working on ClojureScript says otherwise, I would find it a real difficult interpretation of the EPL as applied to ClojureScript to be more restrictive than the GPL. On Wed, Jun 12, 2013 at 2:29 PM, PTCMHB wrote: > Thanks David, > I was confused because when using clojures

Re: Clojure in production

2013-06-12 Thread Lynn Grogan
Plínio, The newest episode of the Relevance podcast is all about Clojure (and Datomic) in production at Roomkey.com. You can find the episode & show notes here: http://is.gd/RAvhqG Cheers! Lynn On Wednesday, June 12, 2013 8:46:41 AM UTC-4, Marshall Bockrath-Vandegrift wrote: > > Plínio Baldui

Re: what directs the program in my-website progream to execute the various files, welcome, users?

2013-06-12 Thread Rob Day
> On Tuesday, June 11, 2013 5:32:46 AM UTC-7, jayvandal wrote: >> >> what statements makes the program execute. >> The main statement tells the program to execute server file >> what statements in the server file tell the program to run the welcome >> file ? the user file Is welcome.clj in src/my_

Re: license of Javascript files generated by Clojurescript?

2013-06-12 Thread PTCMHB
Thanks David, I was confused because when using clojurescript we can't avoid using functions from core libraries and after compiled down to javascript, (parts of) those functions will appear on the final javascript file. So those clojurescript-origin compiled forms are considered "unmodified lib

Re: Data vs API

2013-06-12 Thread Chris Ford
Antonio, I think he means that the onus is on the consumer of an API to make a sensible decision about what they depend on. Consumers could choose to depend on implementation details rather than provided abstractions. When they do so, they need to accept the burden of adapting should those impl

Re: [pre-ANN] test2, the last Clojure testing framework

2013-06-12 Thread Steven Degutis
There's been some discussion about how nesting should work. It should probably be part of the spec, in a flexible and non-intrusive way. Then we would consider a flat suite of tests to be just nested suite that's only a 1-level deep. The two things we want nesting for are defining fixture-like beh

Re: Best IDE

2013-06-12 Thread Stathis Sideris
Ok, in my opinion (and I develop Clojure full-time with Emacs), it's way harder to learn Emacs than for Emacs to learn you ("In Soviet Russia, editor learns you" etc). What I mean: Emacs is very-very-very customizable. If you're learning Clojure, to some extend you are becoming familiar with el

Re: problem using gen-class and using the class name in the same file

2013-06-12 Thread joshrotenb...@gmail.com
On Wednesday, June 12, 2013 9:31:55 AM UTC-7, Armel Esnault wrote: > It works for me!! > Thanks josh, meikel and kelker for your answers. > Glad that works. Also note that my :constructors has a redundant entry: it can just be :constructors {[Object] []} since the type check is in -init. -- -

Re: problem using gen-class and using the class name in the same file

2013-06-12 Thread Armel Esnault
It works for me!! Thanks josh, meikel and kelker for your answers. Le mercredi 12 juin 2013 18:10:37 UTC+2, joshro...@gmail.com a écrit : > > I was messing around recently with creating a Builder class using > gen-class and ran into the same issue since each set* method returns this. > I'm prett

Re: problem using gen-class and using the class name in the same file

2013-06-12 Thread joshrotenb...@gmail.com
I was messing around recently with creating a Builder class using gen-class and ran into the same issue since each set* method returns this. I'm pretty sure it's a chicken and egg issue: the class doesn't exist yet but you need to specify it in the gen-class ... I reworked your example a little

Re: expectations documentation

2013-06-12 Thread Jay Fields
On Tuesday, June 11, 2013 2:39:33 PM UTC-4, Jay Fields wrote: > expectations* has always had a decent amount of documentation; however, > it's traditionally been in the form of blog entries. > > I spent a bit of time and converted those entries into the following site: > http://jayfields.com/ex

clojure proxy does not re-define methods then a Java constructor is called

2013-06-12 Thread Vladimir Tsichevski
Hi, In a Clojure proxy I need to re-define a method which is called by a Java constructor. I noticed that the function dispatch table in the proxy object is not initialized at that moment still, so the original method is always called. Any suggestions? Thanks in advance, Vladimir -- -- You

Re: [ANN] Instaparse 1.1.0

2013-06-12 Thread JeremyS
Hi puzzler, I have a project that I have been meaning to be useable from Clojure and ClojureScript. To do so I am using lein-dalap . I totally agree with you about the issues you have foreseen

Re: [pre-ANN] test2, the last Clojure testing framework

2013-06-12 Thread Stuart Sierra
> I don't fully understand how clojure.test's fixtures plays > into its ability to call test functions from within other > test functions. They don't. Being able to call test functions within other test functions is probably the least-designed and least-used feature of clojure.test. -S -- -- Y

Re: Clojure in production

2013-06-12 Thread Marshall Bockrath-Vandegrift
Plínio Balduino writes: > I'm writing a talk about Clojure in the real world and I would like to > know, if possible, which companies are using Clojure for production or > to make internal tools. At Damballa we’re using Clojure and Cascalog to do all of our Hadoop-based backend data processing.

Re: license of Javascript files generated by Clojurescript?

2013-06-12 Thread David Pollak
The license of the JavaScript generated by the ClojureScript compiler is the license of the source code that was compiled. And that license may be "my company owns it and it's proprietary and we're not licensing it to anyone else." Even the FSF does not assert a GPL over code compiled by GCC even

Re: problem using gen-class and using the class name in the same file

2013-06-12 Thread Armel Esnault
i made the same test without any "-" or "_" the problem is still there Le mercredi 12 juin 2013 11:30:33 UTC+2, Meikel Brandmeyer (kotarak) a écrit : > > Did you check the spelling? - is not valid in a package name. AFAIR using > the classname there should work. > > Meikel > > > > 2013/6/12 Arme

Re: [pre-ANN] test2, the last Clojure testing framework

2013-06-12 Thread Mikera
+1 to that! It would be great if there was some kind of common infrastructure from a tooling perspective, regardless of how the tests actually get written / expressed. If I may add one more thing into the mix, it would be great if we could have some good way to integrate with Java testing fra

Re: problem using gen-class and using the class name in the same file

2013-06-12 Thread Meikel Brandmeyer
Did you check the spelling? - is not valid in a package name. AFAIR using the classname there should work. Meikel 2013/6/12 Armel Esnault > It seems that only the constructor is the problem. it there is workaround > to solve this ? > I have several gen-class calls each need a constructor with

Re: problem using gen-class and using the class name in the same file

2013-06-12 Thread Armel Esnault
It seems that only the constructor is the problem. it there is workaround to solve this ? I have several gen-class calls each need a constructor with an instance of the same class as parameter. Le mercredi 12 juin 2013 11:14:56 UTC+2, Meikel Brandmeyer (kotarak) a écrit : > > Hi, > > test-gen.

Re: problem using gen-class and using the class name in the same file

2013-06-12 Thread Meikel Brandmeyer (kotarak)
Hi, test-gen.Tata should probably be test_gen.Tata everywhere. The reference in the pre-init function should be fine, because the defn is compiled after the generated class is in place. Meikel -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To

Re: problem using gen-class and using the class name in the same file

2013-06-12 Thread Armel Esnault
Yes exactly, i need a constructor which require an instance of the same class as parameter and i need to create new instances of this class in some methods (i implement an abstract class that require this). Le mercredi 12 juin 2013 10:54:15 UTC+2, Kelker Ryan a écrit : > > There are two things

license of Javascript files generated by Clojurescript?

2013-06-12 Thread PTCMHB
Hi all, Sorry if this question is too silly: in EPL's FAQ[1], number 26: *Some free software communities say that linking to their code automatically means that your program is a derivative work. Is this the position of the Eclipse Foundation?* ** No, the Eclipse Foundation interprets the term "d

Re: problem using gen-class and using the class name in the same file

2013-06-12 Thread Kelker Ryan
There are two things that I've notice about your code that could probably be the cause. In the :constructors section of :gen-class, you're refering to test-gen.Tata although it doesn't exist yet. The -pre-init function also tries to call a class that doesn't exist yet. 12.06.2013, 16:39, "Armel Esn

Re: alter a map in a vector (reference)

2013-06-12 Thread Laurent PETIT
Hello, A note about the code organization : I think you should strive to separate the code that does side effects from the code that works on the datastructures. This means you could refactor your refactored version as such: => (def example (ref [{:id 1 :email {"a...@mail.com" 1}}

Re: expectations documentation

2013-06-12 Thread Phillip Lord
It's all working fine now! Phil Jay Fields writes: > Thanks for the report Phillip, I've pushed an update that I hope addresses > your issue. Let me know if things aren't fixed. > > Cheers, Jay > > On Tuesday, June 11, 2013 4:51:08 PM UTC-4, Phillip Lord wrote: >> >> I can't get the nav bar o

Re: Clojure in production

2013-06-12 Thread Mikera
Hi Plínio, At Nuroko, we're using Clojure to develop our machine learning toolkit (using neural networks). The code is a mix of Clojure and Java. Some of our tools have public source code here: https://github.com/nuroko Mike. On Monday, 10 June 2013 22:47:25 UTC+1, Plinio Balduino wrote: >

problem using gen-class and using the class name in the same file

2013-06-12 Thread Armel Esnault
Hi I try to compile a file that generate a class with gen-class that include class name at different places in the file here is a simplified version of the problem: lein init test-gen then edit the core.clj with -- (ns test-gen.core (:gen-class :name test-gen.Tata