Re: Leiningen 2.0.0-preview4

2012-05-15 Thread Alan Shaw
Opened issues for both failures, thanks -A On Mon, May 14, 2012 at 2:02 PM, Phil Hagelberg p...@hagelb.org wrote: On Sat, May 12, 2012 at 3:22 PM, Alan Shaw noden...@gmail.com wrote: In cygwin on win7 I get this: Could you open an issue on Github for this? I don't know enough about

Re: defs in Clojurescript REPL

2012-05-15 Thread Laurent PETIT
Clojurescript doesn't have vars, so why not have def return the symbol ? Le 15 mai 2012 à 06:14, kovas boguta kovas.bog...@gmail.com a écrit : I think this is a pretty valid feature request. The main question is, can this be done without having vars in clojurescript. One way to do it is

Re: defs in Clojurescript REPL

2012-05-15 Thread kovas boguta
Yeah, that is sort of what I was implying in changing the semantics of def Though I wasn't ready to totally committed to that, since I don't understand the properties of symbols in clojurescript. Like, how do go from the symbol to the javascript object we've just bound to the symbol? On Tue,

Re: Faster application startup for rapid development

2012-05-15 Thread Sergey Didenko
Also discovered I can prefix `java -cp ...` with `rlwrap` to get back a nice REPL experience. If you want to use rlwrap, check out its options like --remember, -c, -b and -f. Here is the script I use to run repl from the root of the lein project: breakchars=(){}[],^%$#@\\;:''|\\

Re: Clojure beginner in search of peer-induced enlightenment

2012-05-15 Thread James
Thanks Sean. I'll honor the Contributor's Agreement when time comes for me to introduce some brilliant feature to Clojure core :-) / James On May 14, 7:53 pm, Sean Corfield seancorfi...@gmail.com wrote: On Mon, May 14, 2012 at 10:41 AM, James abbott...@gmail.com wrote: thanks for the

Re: Clojure beginner in search of peer-induced enlightenment

2012-05-15 Thread James
Chris, Sean: No Clojure dojos here but I'll be moving camp soon and will likely start one myself. I'd like to hear what structure of dojo meetings have people used with success? Is it more or less like this: http://web.cs.wpi.edu/~gpollice/Dojo.html ? / James On May 14, 10:21 pm, Sean

Re: Faster application startup for rapid development

2012-05-15 Thread Michael Gardner
There's also nailgun: it keeps a JVM running in the background that Java programs can connect to, eliminating JVM startup time completely. It's totally insecure on multi-user machines and hasn't been updated in a while, but it may be sufficient to ease the pain on developer machines. -- You

Re: defs in Clojurescript REPL

2012-05-15 Thread David Nolen
Returning the symbol seems odd at least to me. I think the best we could do is have a compiler flag so that defs can return nil for REPLs. On Tuesday, May 15, 2012, kovas boguta wrote: Yeah, that is sort of what I was implying in changing the semantics of def Though I wasn't ready to totally

Re: defs in Clojurescript REPL

2012-05-15 Thread Michał Marczyk
Workaround: (do (def foo (build-something-enormous)) nil) As for the reason for this behaviour -- probably non other than it's just the easiest thing for def in ClojureScript to do; it being to inherit the return value from the JavaScript assignment def compiles to. Sticking a void () around

Re: defrecord serialization and *data-readers*

2012-05-15 Thread Stuart Sierra
Data reader literals are not intended to replace record serialization. If you want the flexibility to change your record types, I think you need to use data reader literals from the beginning, and have them deserialize as the appropriate record type. -S -- You received this message because

Re: How to use third-party libraries with Leiningen that are not found in Clojars or Maven

2012-05-15 Thread Tim Visher
On Sat, May 12, 2012 at 12:36 PM, Mads Andreas Elvheim mads.elvh...@gmail.com wrote: I have a few issues which are all related. I'll do my best to explain them one by one. I'd like to use the latest version of the jOGL library with Clojure 1.3 / Leiningen 1.7.1 / OpenJDK 1.6. After getting

Re: defstruct defrecord metadata

2012-05-15 Thread Tim Visher
On Sat, May 12, 2012 at 3:48 PM, JDuPreez jacques...@gmail.com wrote: I'm new to Clojure. I've been unsuccessful in finding a clear answer or getting it to work (might just have done it incorrectly, since I'm still learning). I understand that you can add metadata to an object, with-meta, and

Re: defstruct defrecord metadata

2012-05-15 Thread Stefan Kamphausen
Hi, I am not sure whether I fully understand your question. However, when you create a record, a second constructor will be created for you which also expects a meta-data map: user= (defrecord Foo (bar baz)) user= (meta (Foo. 2 3 {:foo meta} nil)) {:foo meta} Hope that helps. Stefan --

A Clout-like route-matching lib for ClojureScript.

2012-05-15 Thread eduardoejp
Made it for a project I'm working on. Thought it'd be nice to open-source it. It's called Snout. https://github.com/eduardoejp/snout -- 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

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Timothy Baldridge
There seems to be a few steps involved in this from, what I'm seeing. From what I'm seeing of the source, there's two files I'll be dealing with closure.clj -- defines functions for looking up info about libraries, functions, etc. compiler.clj -- actually defines the compiler To start with, I'm

Re: docstrings of if-let and when-let incorrect

2012-05-15 Thread Stuart Sierra
Reasonable enough. Patch welcome. -S -- 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

Re: Reducers

2012-05-15 Thread Stuart Sierra
It's fixed now. On Friday, May 11, 2012 12:30:47 PM UTC-4, Sean Corfield wrote: Just to clarify: Clojure isn't building at the moment _on build.clojure.org_ but you can build it yourself easily enough: -- You received this message because you are subscribed to the Google Groups Clojure

Re: docstrings of if-let and when-let incorrect

2012-05-15 Thread Vinzent
Or maybe if-let and when-let should support multiple bindings, like the doc states. воскресенье, 13 мая 2012 г., 4:55:40 UTC+6 пользователь Borkdude написал: The docstring of if-let is as follows: bindings = binding-form test If test is true, evaluates then with binding-form bound to the

Re: defstruct defrecord metadata

2012-05-15 Thread JDuPreez
Stefan, Thank you for your reply. You are referring to applying an annotation to an instance/object. If we could imagine it existed for the moment, this is what I'd be looking for: (meta {:foo meta} (defrecord Foo (bar baz))) I should then somehow be able to retrieve the metadata of the type

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Kevin Downey
On Tue, May 15, 2012 at 8:05 AM, Timothy Baldridge tbaldri...@gmail.com wrote: There seems to be a few steps involved in this from, what I'm seeing. From what I'm seeing of the source, there's two files I'll be dealing with closure.clj -- defines functions for looking up info about libraries,

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Timothy Baldridge
Logically the interface between the analyzer and the emitter is data (maps, etc) which can be serialized as json or some platform specific representation. Then all you need to do is write an emitter on your platform of choice that can emit code for the data. So for Python: 1. run the

Re: Reducers

2012-05-15 Thread Rich Hickey
I've written another post which goes into the reducers in more detail: http://clojure.com/blog/2012/05/15/anatomy-of-reducer.html Rich On May 10, 2012, at 1:26 PM, Christian Romney wrote: On Thursday, May 10, 2012 8:02:09 AM UTC-4, Nicolas Oury wrote: I can describe the background to

Re: docstrings of if-let and when-let incorrect

2012-05-15 Thread Hubert Iwaniuk
I tried using if-let with multiple binding in past as well. Following least surprise principle, I would like to see support for multiple bindings. Cheers, Hubert. Vinzent mailto:ru.vinz...@gmail.com May 15, 2012 5:47 PM Or maybe if-let and when-let should support multiple bindings, like the

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Kevin Downey
On Tue, May 15, 2012 at 11:25 AM, Timothy Baldridge tbaldri...@gmail.com wrote: Logically the interface between the analyzer and the emitter is data (maps, etc) which can be serialized as json or some platform specific representation. Then all you need to do is write an emitter on your

Re: docstrings of if-let and when-let incorrect

2012-05-15 Thread Evan Gamble
If if-let and when-let don't get support for multiple bindings, you could try https://github.com/egamble/let-else . On Tuesday, May 15, 2012 12:09:08 PM UTC-7, Hubert Iwaniuk wrote: I tried using if-let with multiple binding in past as well. Following least surprise principle, I would like to

Re: docstrings of if-let and when-let incorrect

2012-05-15 Thread Aaron Cohen
Does the principle of least surprise suggest that multiple bindings be combined with AND or OR? --Aaron On Tue, May 15, 2012 at 3:09 PM, Hubert Iwaniuk neo...@kungfoo.pl wrote: I tried using if-let with multiple binding in past as well. Following least surprise principle, I would like to see

Re: docstrings of if-let and when-let incorrect

2012-05-15 Thread Walter Tetzner
On Tuesday, May 15, 2012 3:26:52 PM UTC-4, Aaron Cohen wrote: Does the principle of least surprise suggest that multiple bindings be combined with AND or OR? For `when-let', I would expect it to work like nested when-lets: (when-let [x (exp-1) y (exp-2 x) z (exp-3

Re: docstrings of if-let and when-let incorrect

2012-05-15 Thread Dan Cross
On Tue, May 15, 2012 at 3:26 PM, Aaron Cohen aa...@assonance.org wrote: Does the principle of least surprise suggest that multiple bindings be combined with AND or OR? My own personal opinion is that it makes sense in combination with 'and', but others may feel differently. E.g.,

Re: docstrings of if-let and when-let incorrect

2012-05-15 Thread Walter Tetzner
On Tuesday, May 15, 2012 3:41:58 PM UTC-4, Dan Cross wrote: My own personal opinion is that it makes sense in combination with 'and', but others may feel differently. E.g., (when-let [a (allocate-thing) b (read-into-thing a) c (extract-something-from-thing b)]

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Timothy Baldridge
 I can certainly imagine cases where the analyzer might want reflection on types etc of the given platform, but I think that is really an optimization, trading off compile/analyzer time reflection for runtime reflection. That platform reflective information would be provided by something like

Re: Reducers

2012-05-15 Thread Robert McIntyre
There's a right parenthesis missing at http://clojure.com/blog/2012/05/15/anatomy-of-reducer.html : Now: (reduce + 0 (map inc [1 2 3 4])) ;;becomes (reduce + 0 (reducer [1 2 3 4] (mapping inc)) MISSING PAREN under the heading Reducers sincerely, --Robert McIntyre, Dylan Holmes On Tue, May

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread David Nolen
On Tue, May 15, 2012 at 3:51 PM, Timothy Baldridge tbaldri...@gmail.comwrote: (defn as-str [x] (.toString x)) That can't port to Python, or really any other VM besides JS. So if we're looking at translating the analyzer itself we have to develop some sort of base set of libraries that every

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Timothy Baldridge
Why can't it port to Python? You have can have an instance with a method toString right? The python version of that code (at least in clojure-py) would be this: (defn as-str [x] (py/str x)) So my point is that some platforms may define toString, other define str and still others (CLR) define

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Kevin Downey
On Tue, May 15, 2012 at 12:51 PM, Timothy Baldridge tbaldri...@gmail.com wrote:  I can certainly imagine cases where the analyzer might want reflection on types etc of the given platform, but I think that is really an optimization, trading off compile/analyzer time reflection for runtime

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread David Nolen
On Tue, May 15, 2012 at 4:03 PM, Timothy Baldridge tbaldri...@gmail.comwrote: Why can't it port to Python? You have can have an instance with a method toString right? The python version of that code (at least in clojure-py) would be this: (defn as-str [x] (py/str x)) That would be

Re: docstrings of if-let and when-let incorrect

2012-05-15 Thread Andy Fingerhut
If if-let/when-let had multiple bindings, how would you propose to define the condition of whether to do the then branch? As the logical AND of all of the multiple forms? The OR? Only use the first expression? Only the last? I don't see that any of those is any more clear or least

Re: docstrings of if-let and when-let incorrect

2012-05-15 Thread Michael Gardner
On May 15, 2012, at 3:15 PM, Andy Fingerhut wrote: If if-let/when-let had multiple bindings, how would you propose to define the condition of whether to do the then branch? As the logical AND of all of the multiple forms? The OR? Only use the first expression? Only the last? I don't

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Timothy Baldridge
the point of the analysis step is to generate a richer (more verbose) set of information about the code, there is a lot of information you would like to have when compiling (for example, for some platforms it would be nice to know at the start of a function what locals exist in the that function,

[ANN] clojure-encog 0.3.0 released on clojars

2012-05-15 Thread Jim - FooBar();
Hello folks, I'm happy to announce the release of clojure-encog, a thin wrapper around Encog AI framework 3.1. Basically i did this so i could use it for a project of mine but I guess someone else might find it useful as well...especially if someone does not want to get down and dirty with

Re: Faster application startup for rapid development

2012-05-15 Thread MarkSwanson
reloading code at the REPL, because old background threads may still be running with old code. So I end up restarting the process many times per day. I usually create a 'restart fn that closes down the background threads and services and restarts them. This might require you to add a

Re: docstrings of if-let and when-let incorrect

2012-05-15 Thread Dan Cross
On Tue, May 15, 2012 at 3:47 PM, Walter Tetzner robot.ninja.saus...@gmail.com wrote: On Tuesday, May 15, 2012 3:41:58 PM UTC-4, Dan Cross wrote: My own personal opinion is that it makes sense in combination with 'and', but others may feel differently.  E.g.,     (when-let [a (allocate-thing)

Re: Reducers

2012-05-15 Thread Rich Hickey
Fixed - thanks. Rich On May 15, 2012, at 3:54 PM, Robert McIntyre wrote: There's a right parenthesis missing at http://clojure.com/blog/2012/05/15/anatomy-of-reducer.html : Now: (reduce + 0 (map inc [1 2 3 4])) ;;becomes (reduce + 0 (reducer [1 2 3 4] (mapping inc)) MISSING PAREN

Best way to write an InputStream to disk

2012-05-15 Thread Raju Bitter
What is the best way to write an FilterInputStream or InputStream do disk? I'm downloading a file using the clj-http library: (:body (client/get http://www.openlaszlo.org/pipermail/laszlo-dev/2012-May.txt.gz; {:as :stream}) That returns the response body as a FilteredInputStream, which I need to

Re: Best way to write an InputStream to disk

2012-05-15 Thread Robert Marianski
On Wed, May 16, 2012 at 02:15:59AM +0200, Raju Bitter wrote: What is the best way to write an FilterInputStream or InputStream do disk? I'm downloading a file using the clj-http library: (:body (client/get http://www.openlaszlo.org/pipermail/laszlo-dev/2012-May.txt.gz; {:as :stream})

Re: Best way to write an InputStream to disk

2012-05-15 Thread Raju Bitter
Thanks a lot, that worked for me. Raju -- 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

Unable to replace static Java method with Clojure function

2012-05-15 Thread Matthew Boston
I currently have a static method in Java. I have rewritten it in Clojure. I wish to allow the rest of the Java app to call the new function with minimal change. Still getting NumberValidator cannot be resolved even after reading the following SO post and it's not helping for my particular

Clojurescript NS question

2012-05-15 Thread Oded Badt
In: https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure It is written than: You must use the :as form of :require Does this basically mean there is no natural way to write a set of functions and import them globally (with no namespace prefix)? For example I would like

Re: Clojurescript NS question

2012-05-15 Thread Oded Badt
Sorry, meant to quote: :use is not supported On Wednesday, May 16, 2012 8:36:24 AM UTC+3, Oded Badt wrote: In: https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure It is written than: You must use the :as form of :require Does this basically mean there is no

Re: Unable to replace static Java method with Clojure function

2012-05-15 Thread Meikel Brandmeyer (kotarak)
Hi, you are sure that your AOT compiled class files are on the classpath before compiling the Java side? 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