Re: Docs on standard protocols
Unfortunately, I am not aware of any comprehensive documentation for the internal Java implementation of Clojure's core data types. The source code is the only definitive resource. Introspection can help. For example, to get a list of everything you need to implement to support map-like behavior: user= (ancestors (class {})) #{clojure.lang.IObj clojure.lang.Seqable clojure.lang.IHashEq clojure.lang.IMeta java.util.concurrent.Callable clojure.lang.IFn java.io.Serializable clojure.lang.IEditableCollection clojure.lang.APersistentMap clojure.lang.Associative java.util.Map clojure.lang.IPersistentCollection java.lang.Object clojure.lang.AFn java.lang.Runnable clojure.lang.Counted clojure.lang.MapEquivalence java.lang.Iterable clojure.lang.IPersistentMap clojure.lang.ILookup} -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 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
Re: Clojure expression benchmarks
Thanks for putting this together, Andy! It's great to have this data. -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 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
Re: printing for non-human consumption but want *read-eval* false
*print-dup* tries to preserve type information. That's why it emits constructor functions with #=. You can still use 'pr' with *print-dup* set to false, which is the default. You get machine-readable data of the correct abstract type, e.g. list/vector/map/set, but you lose type information like whether it's a hash-map or a sorted-map. -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 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
Re: [ANN] new book: ClojureScript: Up and Running
`lein trampoline` was required to permit the CLJS REPL process to grab STDIN/STDOUT. According to a recent thread on the Leiningen mailing list, this may have been fixed in the Git master branch of Leiningen. -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 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
Re: printing for non-human consumption but want *read-eval* false
`spit` calls `str` on its argument, which has the same behavior as `print` or `println` with regard to quoting strings: user= (println I say, \Hello, World!\) I say, Hello, World! nil To preserve data in its `read`able form, you need `pr` or `prn`: user= (prn I say, \Hello, World!\) I say, \Hello, World!\ nil Note that with `prn` the string is enclosed in double-quotes and quotation marks inside the string are backslash-escaped. You can still use `spit` as you were before, just call `pr-str` on the data first: user= (pr-str I say, \Hello, World!\) \I say, \\\Hello, World! -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 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
Re: Idiomatic equivalent for double dispatch in clojure?
A long time ago I posted some macros to do double-dispatch with protocols and records. The link was http://paste.lisp.org/+2023 but it no longer works. The basic idea is you dispatch on the first argument to an intermediate type that then dispatches on the second argument. It's complicated, but essentially mechanical. Clojure multimethods have built-in multi-argument dispatch. -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 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
Re: explicit progression-of-time constructs? (wikipedia)
I expect the Wikipedia article is referring to Clojure's mutable reference types -- Ref, Atom, Agent, Var -- which help to manage state that changes over time. See also http://clojure.org/state and http://clojure.org/concurrent_programming -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 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
Re: Are agents suitable for c10k concurrency?
What matters is the I/O framework. You'll want to use a non-blocking network library, then you should be able to use `send` rather than `send-off`. `send` uses a fixed-size thread pool for all Agents in the system. That said, while I believe Agents are a suitable solution to this problem, they have not been extensively tested at high load in production applications. I recommend profiling and benchmarking with your expected workload to see if Agents will provide the features you need. -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 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
Re: CLJS-418: Unspecified dependency on google-closure-library-third-party
The real question I'm hoping somebody can answer is: what changed to cause this? The G.Closure library or ClojureScript? -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 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
Re: [ANN] ClojureScript release 0.0-1535 with G.Closure 0.0-2029
Tracking this at http://dev.clojure.org/jira/browse/CLJS-418 -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 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
CLJS-418: Unspecified dependency on google-closure-library-third-party
http://dev.clojure.org/jira/browse/CLJS-418 We currently distribute the Google Closure Library in two separate JARs: the main library and the third-party extensions. We do this because the third-party extensions are covered by different licenses. But, as it turns out, various classes in the main library have explicit dependencies on things in the third-party extensions. See See also this G.Closure mailing list discussion: https://groups.google.com/d/msg/closure-library-discuss/4DG-XJn0s4E/i7nlq84V41kJ As a result, the ClojureScript browser-connected REPL has a transitive dependency on the Google Closure Library third-party extensions. This manifests as an error in script/cljsc and a NullPointerException in lein-cljsbuild. It seems that the dependency on third-party extensions is unavoidable. There are several possible fixes: 1. Release a new G.Closure Library JAR with a *declared dependency* on the third-party extensions JAR. This best reflects the *actual* dependency relationships. 2. Release a new G.Closure Library JAR with the third-party extensions included in the JAR. This would make it harder to exclude the third-party-licensed code from projects which do not actually require it. 3. Release a new version of ClojureScript with a declared dependency on the third-party extensions JAR. This makes the dependency more visible to ClojureScript developers. Regardless of the approach taken, developers can always use explicit dependencies/exclusions to choose which version of the G.Closure library to include in their projects. -- 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
Re: CLJS-418: Unspecified dependency on google-closure-library-third-party
I should mention, there's an easy temporary fix: just add the third-party library as a dependency in your project: ;; In :dependencies vector of Leiningen's project.clj [org.clojure/google-closure-library-third-party 0.0-2029] -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 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
Re: freeing resources while generating lazy sequences
Lazy sequences do not interact well with resources that need to be closed. This is a long-standing issue, and no universal solution has been found. The usual recommendation is to manage the resource in a higher scope than the process that uses it. In your case, rather than creating the iterator and seq in the same function, create the iterator higher up the call stack where it can be managed by 'with-open' or an equivalent. Then create the lazy seq where you need it. As to why iterator-seq doesn't work, your code appears to be using an Iterator interface (peekNext) which is different from Java's standard iterator: http://docs.oracle.com/javase/6/docs/api/java/util/Iterator.html -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 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
Re: [ANN] ClojureScript release 0.0-1535 with G.Closure 0.0-2029
My original reason for splitting the third-party JAR was the licensing: the main G.Closure library is under the Apache license; the third-party libraries are under a variety of different licenses. One simple solution would be to make ClojureScript itself have a dependency on the third-party libs in addition to the core G.Closure libraries. Then users would still have the option of excluding the third-party extensions from their projects. -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 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
Re: How to get the namespace for an unqualified symbol?
Assuming the symbol is bound to a Var, you can do this: (name (ns-name (:ns (meta (resolve 'x) -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 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
Re: lein-midje-lazytest
Hi, I have not continued development of Lazytest, but I took most of the code-reloading parts and refactored them into tools.namespace 0.2.x: https://github.com/clojure/tools.namespace tools.namespace might make a better foundation for a development tool. Thanks for your interest in Lazytest. -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 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
[ANN] ClojureScript release 0.0-1535 with G.Closure 0.0-2029
ClojureScript release 0.0-1535 is out. Get it in Leiningen: [org.clojure/clojurescript 0.0-1535] Change log for this release: http://build.clojure.org/job/clojurescript-release/19/ This release depends on the latest version of the Google Closure Library, r2029. You can also depend on it explicitly: [org.clojure/google-closure-library 0.0-2029] ClojureScript does NOT depend directly on the Google Closure Library third-party extensions, but you can get it: [org.clojure/google-closure-library-third-party 0.0-2029] -- 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
Re: [ANN] new book: ClojureScript: Up and Running
On Thursday, November 8, 2012 4:14:03 PM UTC-5, Robert Pitts wrote: Awesome. Would you say that this is essentially a completed work? Growing weary or reading and re-reading beta books lately. Yes, the book is finished and out of beta. There may still be periodic updates and bug fixes to the eBook in the future. -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 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
Re: gen-class with :extend and overloaded methods in superclass
Hi Bartek, In this case, I don't think `gen-class` has any part to play at all. All `gen-class` does is generate a class with stub methods that dispatch to Clojure functions by name. What matters is an expression like `(.f this a)`. If the Clojure compiler can statically determine the types of `this` and `a`, it will emit bytecode to invoke the correct method directly. If it CANNOT determine the types, it will emit bytecode that uses Java's reflection APIs to find the appropriate method at runtime. The Clojure compiler will never call the WRONG method, but the reflective version is much slower. You can check for reflection by running: (set! *warn-on-reflection* true) in the REPL before loading/compiling your code. To prevent the reflection warning, you can add type hints to the symbols. -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 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
Re: with-open and line-seq
On Wednesday, November 7, 2012 2:29:06 PM UTC-5, Jim foo.bar wrote: This is exactly the approach I'm taking...'doall' retains the head so with massive files it will break...'doseq' will not. at least this is my understanding... That is correct. `doall` retains the head because it returns the entire sequence. `doseq` and `dorun` do not retain the head, both return nil. -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 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
[ANN] new book: ClojureScript: Up and Running
Not to toot our own horn, but people have been asking about getting started with ClojureScript, so here's our contribution, just released in book form: ClojureScript: Up and Running by Stuart Sierra and Luke VanderHart published by O'Reilly in paper, eBook, and Safari http://shop.oreilly.com/product/0636920025139.do -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 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
Re: Java-to-Clojure source translation?
On Sunday, November 4, 2012 4:18:27 PM UTC-5, Vladimir Tsichevski wrote: That's why I'm looking for means which could HELP me rewrite my code base to Clojure, not to produce compilable and runnable code. Just parse Java syntax tree and pretty-print it back as Clojure-like text. Even if such a converter existed, I believe the output would be almost meaningless. Sure, you could represent Java source code in S-expressions, but it wouldn't be any closer to usable Clojure code than the original Java source was. -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 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
Re: impossible to create classes for non-closure environment
Hello, Clojure (by the way, it is not spelled closure) is not really designed to generate pure-Java classes. `gen-class` is slightly more flexible than `deftype`, but it will still generate references to Clojure classes. If the structure of your Java classes is defined by interfaces, `deftype` can implement those interfaces. But if the structure of the Java classes is very regular, you may find it easier to generate Java source code as strings. That's how all the primitive interfaces in clojure.lang.IFn were created. -S On Sunday, November 4, 2012 4:43:59 AM UTC-5, Vladimir Tsichevski wrote: Thank you Stephen, the problem is that it is impossible to create create a Java class using closure with the following characteristics: 1) all methods must match given Java signature. For example, if I need a method public String getSomeString(); all I get is public Object getSomeString(); closure ignores my String hints and always uses Object instead. 2) must be no references to any closure classes. Now the closure compiler unconditionally creates at least one extra method public static IPersistentVector getBasis() which references several classes from closure runtime. Regards, Vladimir On Sat, 2012-11-03 at 13:57 -0700, Vladimir Tsichevski wrote: In one of my purely Java project I have to create hundreds of java classes with repeatable structure, so the task is an excellent candidate for automation. I hoped I will be able to create these classes with the latest closure, using the 'deftype' construct. If you know all the details of classes to create at compile time, you can use macros instead, which are perfectly well able to output deftype forms. Untested: (defmacro defrefs Make a bunch of :x boxes. [ names] `(do ~@(map (fn [name] `(defrecord ~name [~'x])) names))) ;; makes classes foo, bar, baz, qux, quux, all with the :x field. (defrefs foo bar baz qux quux) -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- 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
Re: Java-to-Clojure source translation?
Hello, It is not really possible to make a direct translation from Java to Clojure. Java has mutable variables and imperative flow-control, for which there is no equivalent in Clojure. -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 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
Re: Clojure CA over email thread on clojure-dev
The discussion on the clojure-dev list is not about *if* CAs will be accepted electronically, but *how*. Stuart Halloway requested help finding examples of the processes that other organizations have developed for receiving contributor agreements. In particular, he wanted to know if some large open-source organization has already done the appropriate legal research. We already know the paper CA process is a pain. We're trying to make it better. -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 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
Re: clojure.org requires more clicks now
Hello Heinz, I'm sorry you're finding navigation difficult on Clojure.org. I agree that fewer clicks are better, but we (me, Stuart Halloway, and a few others) felt that the site was getting cluttered with too many links, which was confusing to newcomers. It would be nice if the Documentation link in the left-side column could expand into a list of sub-sections, but I don't know if the technology behind the site (Wikispaces) can support that right now. -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 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
Re: with-open and line-seq
On Friday, October 26, 2012 11:11:48 PM UTC-4, daveray wrote: I guess I looking for a magical line-seq that closes the file correctly even if you consume part of the sequence, is resilient to exceptions, etc, etc. I realize that it might be impossible, so I asked. :) It's been discussed extensively in the past, but no one has come up with a solution that adequately solves the general problem. See http://dev.clojure.org/display/design/Resource+Scopes for examples of some attempts. The best approach I've found is to manage resources like files farther up the stack. Instead of having a 'with-open' block that returns a sequence, put the 'with-open' block at a higher level, so that it encompasses the entire scope in which the file will be used. -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 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
ANN: data.json 0.2.1 and tools.namespace 0.2.1
[org.clojure/data.json 0.2.1] * restores deprecated API functions from 0.1.x releases * recommended over 0.2.0, which broke code that depended on the old API [org.clojure/tools.namespace 0.2.1] * minor bugfix * restores deprecated API functions from 0.1.x releases * recommended over 0.2.0, which broke code that depended on the old API * still may not work alongside other code-reloading tools, see https://github.com/clojure/tools.namespace#warnings -- 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
Re: ANN: data.json 0.2.0
It is done. data.json 0.2.1 coming to a repository near you. http://build.clojure.org/job/data.json/77/ https://github.com/clojure/data.json/tree/data.json-0.2.1 -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 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
Re: ANN: data.json 0.2.0
I am not opposed to having a shim to support an API compatible with older releases. It's not even particularly difficult: https://gist.github.com/3950124 I certainly did not anticipate this release causing significant problems for application or library developers, and if it did then I apologize. However, I will stand by the decision to update the API. data.json 0.1.x suffered from what I consider, in retrospect, to be poor design decisions. Those were decisions I made over two years ago in a hasty effort to please too many people who had conflicting goals: - Converting field names to keywords by default can create invalid keywords. - Keywordization is controlled by a bare boolean argument with little indication of its function. - Inconsistent styles of optional arguments: read-json and write-json take booleans as bare arguments, json-str and print-json use keyword-value pairs. - Parsing a string and parsing from a stream -- two very different operations -- are conflated in a single function. - Functions are not consistently named: json-str, read-json, write-json - Function names repeat the name of the library, rather than using namespaces. It was impossible to solve some of these problems without introducing breaking changes. Looking at the Clojure Library Coding Standards[1], data.json 0.2.0 does a better job at Use good names and Unroll optional named arguments. It fails at Java's commitment to not break existing code. In this instance, I believe the tradeoff is worthwhile because the new API can be more easily extended with additional arguments. This also opened up a place to add new features such as customizable conversion functions, the most-commonly-requested feature for this library. Per Rich's directive[2], I cannot yet make a 1.0.0 release. Therefore, 0.1.3 to 0.2.0 is the largest version bump I can make and the best indication I can give of breaking changes. I hope that these improvements to the API bring this library closer to a 1.0.0-ready state. I'm not trying to make anyone's life more difficult, just trying to provide useful tools. -S [1]: http://dev.clojure.org/display/design/Library+Coding+Standards [2]: http://dev.clojure.org/display/design/Contrib+1.0.0+Releases -- 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
Re: ANN: data.json 0.2.0
I'm sorry for causing people extra work. How's this for a solution: https://github.com/clojure/data.json/commit/6ee71009946731d89ef8f98e7b659fa82443b6a2 This allows the 0.2.x code to pass all the tests for data.json 0.1.3. I can't retract the 0.2.0 release, but if I push this out as 0.2.1 the compatibility issues should be at a minimum. -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 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
Re: [ANN] nrepl.el 0.1.5 released
Thanks so much for working on nREPL.el, Tim. -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 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
ANN: data.json 0.2.0
https://github.com/clojure/data.json Highlights: - New API - Customizable type conversion functions - big int and big decimal support - Performance improvements -- 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
ANN: ClojureScript release 0.0-1513
ClojureScript release 0.0-1513 is on its way to the Maven Central Repository. Changes: http://build.clojure.org/job/clojurescript-release/18/ -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 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
Re: Replacing nested let statements with assignments
It's slightly different, but libraries such as Flow or Prismatic's Graph can be used to achieve a similar effect. Flow: https://github.com/stuartsierra/flow Graph: http://blog.getprismatic.com/blog/2012/10/1/prismatics-graph-at-strange-loop.html Example using Flow: (def the-flow (flow b ([a] (println This is a: a) 2) c ([b] (println This is b: b) 3) out ([a b c] (println This is c: c) (+ a b c (def the-fn (flow-fn the-flow [a] out)) (the-fn 1) ;; This is a: 1 ;; This is b: 2 ;; This is c: 3 ;;= 6 -- 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
Re: Correct usage of data-readers
- is it appropriate to include data_readers.clj in a library - given that file is in the root? No. data_readers.clj is intended for application developers. Libraries may define data reader functions and suggest tags for consumers of that library. -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 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
Re: Smarter code reloading with tools.namespace 0.2.0
#FileNotFoundException java.io.FileNotFoundException: Could not locate clojure/tools/namespace__init.class or *clojure/tools/namespace.clj* on classpath: Now, somewhere in the code, something is looking for clojure.tools.namespace.clj. But that's just a directory in the projecthttps://github.com/clojure/tools.namespace/tree/master/src/main/clojure/clojure/tools/namespace. I can't see anywhere in the codebase that tries to use or require that file. Something must be trying to load 'clojure.tools.namespace', which was a real namespace in the tools.namespace 0.1.x releases. Perhaps something in Ritz is trying to load it. -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 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
Re: Correct usage of data-readers
One data_readers.clj file can't override another: it's an error if they contain the same tags with different functions. So if a library defines its data reader tags, you can't override them *at read-time* in your app. You can always override readers dynamically at run-time by binding *data-readers*. -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 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
Re: Smarter code reloading with tools.namespace 0.2.0
'ring-devel' depends on 'ns-tracker', which uses tools.namespace 0.1.3: https://github.com/weavejester/ns-tracker/blob/master/project.clj Dependency resolution will only allow one version of the library, so your project gets tools.namespace 0.2.0, not 0.1.3. The two releases are not compatible, which is documented in the README. This will have to be fixed in ring-devel and/or ns-tracker. -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 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
Re: where is pvmap?
pvmap never made it into the main branch. The new 'reducers' library in Clojure 1.5 takes its place. -S On Saturday, October 13, 2012 9:50:23 AM UTC-4, Jim foo.bar wrote: I am struggling to find the namespace in which 'pvmap' lives! Can anyone help? Jim -- 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
ANN: ClojureScript release 0.0-1503
Available in the Maven Central Repositories: http://search.maven.org/#artifactdetails%7Corg.clojure%7Cclojurescript%7C0.0-1503%7Cjar Complete change log: http://build.clojure.org/job/clojurescript-release/17/ Leiningen dependency information: [org.clojure/clojurescript 0.0-1503] -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 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
Re: Intern a var from outside namespace
Sounds like a load-order issue. Make sure the code *creating* the namespaces/vars is loaded before the code *using* them. But better yet, just don't do it. :) -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 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
Re: Bug in printing futures
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 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
Re: Question on mandatory arguments for - and - macros
Thank you, especially thanks for tagging it an enhancement. -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 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
Re: concat files after pmap
You could use clojure.java.io: (require [clojure.java.io :as io]) (defn cat-files [output-file input-files] (with-open [stream (io/output-stream output-file)] (doseq [file input-files] (io/copy (io/file file) stream -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 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
Re: bug in clojure.lang.ASeq
I would recommend serializing as strings via pr/read over Java serialization, but this still sounds like a legitimate bug. -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 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
Re: understanding 'binding' use in clojure.java.jdbc
On Tuesday, October 9, 2012 10:25:05 PM UTC-4, Sean Corfield wrote: This is why c.j.jdbc is getting an API overall that will expose functions that accept the connection or the db-spec directly (and the old API will be rewritten in terms of the new one for compatibility). Excellent. -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 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
Re: adding clojure.test/assert-expr methods
clojure.test is weird (my fault) but I don't think it's that weird. Your 'defmethod' is correct, but it shouldn't need the 'binding' around it. This works for me: user= (require '[clojure.test :as t]) user= (defmethod t/assert-expr 'fail [msg form] `(t/do-report {:type :fail :expected nil :actual nil :message ~msg})) #MultiFn clojure.lang.MultiFn@418bdc7a user= (t/deftest a-test (t/is (fail) Failure)) #'user/a-test user= (a-test) FAIL in (a-test) (NO_SOURCE_FILE:1) Failure expected: nil actual: nil -- 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
Re: File endings proposal for easier cross-compiling
Feature Expressions provide an escape from file extensions. http://dev.clojure.org/display/design/Feature+Expressions Everything could become a .clj file. Sources dedicated to different targets would live in different directories. -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 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
Re: Smarter code reloading with tools.namespace 0.2.0
Hi Mika, Due to the current governing process of the Clojure contributor agreement, I cannot accept GitHub pull requests, only patches submitted via http://dev.clojure.org/jira My intent is for the functions in clojure.tools.namespace.repl to be a high-level API for direct invocation by users. All the components are exposed in the namespaces c.t.n.track, c.t.n.files, etc. You should be able to compose the various pieces for different use cases. If you encounter a place where this is not possible, let me know and I will look into it. -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 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
Re: cli latency
JVM startup time has always been issue. Various tricks help: client mode, smaller heaps, tiered compilation (available in Java 7). Clojure adds another layer, which can be partially mitigated with AOT-compilation. But you'll never get the kind of instant command-line response that C can give you. The JVM doesn't support saving and restoring an image of memory like some VMs. One workaround is to write your command-line tools to run within a dedicated shell that only has to be started once. Like writing your own REPL, but customized for your users. Also consider alternative backends: ClojureScript can emit code for Node.JS, and I think there is an experimental port that compiles to native code (via Scheme). -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 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
Re: Preferred business rules engines in or used by Clojure?
Hi Grant, I am not aware of a rules engine written in Clojure, unless you are willing to consider a logic language like Datalog (Datomic) or Prolog (core.logic). Various rule-based systems exist for Java, but I would expect them to be very Java-centric. -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 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
Smarter code reloading with tools.namespace 0.2.0
Announcing... tools.namespace 0.2.0. Just released, it will reach Maven Central in a few hours. Short summary: reload code in the REPL with greater accuracy and awareness of dependencies. Full documentation in the README: https://github.com/clojure/tools.namespace This is my latest attempt at making REPL development more convenient, building on work that reaches back to Lazytest and some of my earliest contribs. It is hopefully a step towards Never Close a REPL: http://dev.clojure.org/display/design/Never+Close+a+REPL Have fun, let me know how it goes! -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 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
Re: Meaning of =
On Wednesday, October 3, 2012 1:56:19 PM UTC-4, Warren Lynn wrote: Out of curiosity, if we want to check if two collections has the same structure/type and elements, namely if I want (my-equal [1 2 3 4 '(5)] [1 2 3 4 [5]]) = false (my-equal [1 2 3 4 [5]] [1 2 3 4 [5]]) = true Is there any convenient way to do that? Not really. You would have to define your own equality function. Then you have to make all the decisions about what should be considered equal. For example, lists versus sequences, hash-maps versus array-maps. -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 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
Re: maplist for core?
Never had a use for such a thing, myself, but it sounds like a reasonable candidate for https://github.com/clojure/core.incubator at least. -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 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
Re: google-closure-library 2029
I made the G.Closure library artifacts and manually uploaded them to Maven Central. I haven't had time to do the latest G.Closure library release. Can somebody confirm that ClojureScript works 100% with the rev. 2029 release of the Closure Library? -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 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
Re: clojurescript: *ns*, all-ns, ns-map, ns-publics, ns-* ?
Some of this information exists in the CLJS compiler, although it's not documented. For example, the cljs.analyzer namespace has *cljs-ns* and `namespaces`. You could examine these Vars at the Clojure (not ClojureScript) REPL. Vars and namespaces do not exist at all in compiled CLJS code, so you can't access them from CLJS. This is unlikely to change. -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 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
Re: how do we go about promoting new clojure libraries?
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 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
Re: how do we go about promoting new clojure libraries?
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: http://clojure.org/contributing 2. You will receive an editor account on http://dev.clojure.org/ 3. Start editing! Thanks! -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 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
Re: JSON serialization with unknown types
I'm working on a new version of data.json that supports conversions: https://github.com/clojure/data.json/tree/transform Feedback welcome on the API. -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 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
Re: Request to create new contrib: data.dependency
It's open source. You can do whatever you want, under the terms of the EPL. -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 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
Re: Request to create new contrib: data.dependency
I didn't get approval to create data.dependency, so instead I've merged that work into tools.namespace, currently available as 0.2.0-SNAPSHOT. -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 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
Re: Can't start Rhino repl for ClojureScript
Leiningen works under Windows (as lein.bat). I'm not sure if it works under Cygwin. I've encountered problems in the past with Cygwin because the Java executable is the Windows version, using Windows path-separator characters, but scripts expect Unix-style path separators. Try downloading Leiningen for Windows and running from the Windows shell. -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 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
Re: Why do Clojure collections have (seq) rather than supporting the ISeq interface directly?
Mostly efficiency. A Seq generally gives you access to `first` and `rest` in constant time. Vectors, to take one example, cannot give you `rest` efficiently, but a Seq backed by the vector can. Clojure lists are implemented as singly-linked lists, which do have first/rest pointers, so they implement ISeq directly. -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 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
Re: A Performance Comparison of SBCL Clojure
Just wanted to say thanks for putting in all the work on the shootout programs, Andy. On Friday, September 7, 2012 1:12:44 AM UTC-7, Andy Fingerhut wrote: All Clojure programs within 4x the run time of the corresponding Java programs, averaging around 2.5x the run time of Java. That's pretty darn good. Lesson I've learned: If you've got an inner loop of your program that you really really need to run faster, code it in Java, C, or even assembler. Use profiling tools to find those spots, rather than guessing where you think they might be. Agreed. -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 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
Re: redefining multimethods at the repl
This is what I started working on tools.namespace to solve. I came to the conclusion that it's impossible to make something that works in 100% of all cases, but I'm hoping to get to 90%. I added some notes to the wiki page too. -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 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
Re: [emacs over ssh limitations]
SSH in iTerm 2 from an OS X machine to a Linux server. $TERM is xterm-256color at both ends. We use this for pair-programming, so X and tramp are not helpful. -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 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
Re: A Performance Comparison of SBCL Clojure
Maybe my impressions are out of date. Personally, I have neither the time nor the interest, but optimizers do your stuff! -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 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
Re: [emacs over ssh limitations]
It's easy enough to test: fire up a small EC2 instance and use Emacs over an SSH+tmux session. You could also try using your own local Emacs that way by SSH'ing to localhost. In my experience, commands don't work in a terminal if they use modifier keys (Control, Meta, Shift) AND non-letter keys (arrows, ENTER, some punctuation). I assume it has something to do with how those combinations get encoded for the terminal emulator. You can always work around it with M-x, or by rebinding the command to a different key. It's mildly annoying, but not a showstopper. One consistently annoying thing is that PageUp, PageDown, and Delete don't work in clojure-mode buffers with Paredit in Emacs in a terminal. They insert weird characters like ^[ instead. I would very much like to have a fix for that! -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 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
Re: A Performance Comparison of SBCL Clojure
The Alioth benchmarks are somewhat unfair to JVM languages because they include startup time for the JVM itself and often don't run enough iterations to engage the optimizer. -S On Sat, Aug 25, 2012 at 1:51 PM, Raymond de Lacaze del...@hotmail.comjavascript: wrote: Here’s a performance benchmark comparison of SBCL and Clojure. http://shootout.alioth.debian.org/u32/benchmark.php?test=alllang=clojurelang2=sbcl -- 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
Re: Performance of concatenating two vectors
I haven't read the paper, but Clojure's PersistentVector doesn't really have a concatenate operation. The `concat` function creates a lazy sequence. The closest to vector concatenation is probably `into`, which is implemented in terms of `reduce`. -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 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
Re: [viewing clojure datastructures] Is there something better than clojure.inspector?
Somewhat-related, I started working on a graphical pretty-printer library for ClojureScript: https://github.com/stuartsierra/cljs-formatter Here's a screenshot: https://github.com/stuartsierra/cljs-formatter/blob/master/screenshot-1.png -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 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
Re: Central screwup
Just want to make this is clear: no one on the Clojure mailing list (or IRC) has any direct control over the major public repositories. The Maven Central Repository (repo1.maven.org) is managed by the Apache Foundation with help from Sonatype, Inc. See http://www.sonatype.com/people/2011/03/enhancements-to-maven-central/ The Sonatype Open-Source repository (oss.sonatype.org) is managed by Sonatype, Inc. It syncs with the Maven Central Repository every few hours. Only Clojars (clojars.org) is managed by the Clojure community. -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 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
Re: Central screwup
Thanks, Phil, -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 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
Re: clojure.logic project.clj file
On Wednesday, August 15, 2012 9:39:21 PM UTC-4, Chas Emerick wrote: I'd hope to see this change once the final missing pieces fall into place (in particular, automation of promotion of releases through Nexus' API corresponding to or surpassing what nexus-maven-plugin provides). http://groups.google.com/group/leiningen/browse_frm/thread/94732d6de1d06b59 Me too. Once Leiningen can do a fully automated build-sign-deploy-promote we can look into switching. There would still be a significant amount of work to change how we use Hudson (build.clojure.org) because all the job configurations assume Maven. It could be done, just would need someone to do it. -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 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
Re: basic question , clojure io
No, there is no language-level distinction between pure functions and functions which perform side effects. In practice, it is a good idea to keep them separate. -S On Tuesday, August 7, 2012 9:37:31 AM UTC-4, centaurian_slug wrote: does clojure have a strict split between side-effects and pure functions like haskell; I guess what i have in my head is a rigorous split between effectfull 'procedures' and pure 'functions',the latter cannot call the former; although i know thats' implemented through the more general mechanism of monads in haskell. -- 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
Re: How to add an URL into the classpath?
You can't. The dynamic classloader is an internal implementation detail of Clojure; you can't rely on it being available anywhere. If you're interested in runtime control over the the Java classpath, look at https://github.com/cemerick/pomegranate -S On Sunday, July 29, 2012 2:05:00 PM UTC-4, Yoshinori Kohyama wrote: Hello programmers, Hi, Sierra. Thank you replying. O.K. I can not always contol the classloader of the whole JVM. Then, how can I get the dynamic classloader for my current code/thread? Or can't I? Regards, Yoshinori Kohyama -- 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
Re: How to add an URL into the classpath?
Hello Yoshinori, In general, you cannot modify the JVM classpath at runtime. Clojure uses its own classloader to do dynamic code generation, but you cannot rely on being able to control the classloader which is running the whole JVM. -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 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
Re: slurp on over slow HTTP crashes clojure?
The 'slurp' function on a URL dispatches to java.net.HttpURLConnection, which is pretty primitive as HTTP clients go. If you need to handle slow sites or large responses, you'll probably be better off with a real HTTP client library. -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 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
Re: Tagged literals: undefined tags blow up reader
Hi Kovas, I considered the problem of what to do with undefined tags when I implemented this, but I didn't have a clear idea of what the result type should be, so I ignored it. I also didn't know what to do with the metadata. For example, on the JVM, you can't put metadata on Java types like String or Date. If there's metadata on the tagged type, do you try to preserve it? For that matter, what does the reader do now if you try to put metadata on a tagged literal that evaluates to a type which doesn't accept metadata? I assume the reader blows up there too. Other similar tagging systems allow undefined tags to be passed through, and I think this is the right approach. You can represent any tagged literal as a symbol, data pair, and this pair deserves its own type. I'd call it TaggedData. It should implement the interface that handles metadata (IObj in Clojure on the JVM I think). I like the idea of being able to define how tagged literals should be emitted without mucking about with strings. At first glance, your approach seems reasonable. Are you on Clojure/dev? To move this forward, you can put a design proposal on dev.clojure.org. Keep in mind that tagged literals went through months of discussion before the implementation: http://dev.clojure.org/pages/viewpage.action?pageId=950382 -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 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
Re: Central screwup
Is there anyone on the Clojure/core team with a contact among those who run Central who could get them to look into this? I'm on the Sonatype OSSRH mailing list: https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide (mailing list addresses at the bottom) There was no mention of this issue there, but I'll ask about it. -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 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
Re: Problems resolving dependencies due to maven central repo fail
Hi Craig, I can't reproduce the problem you're seeing. Right now, when I visit http://repo1.maven.org/maven2/org/clojure/clojure/maven-metadata.xml I get the the same list as Article A in your original post. Is it possible that the maven-metadata-central.xml file in your local Maven cache is corrupted? You can try deleting ~/.m2/repository/org/clojure/clojure/ and see if the problem persists. -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 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
Re: clashing methods between 2 different protocols???
I see you have found that you can override Object.toString in defrecord by including Object in your defrecord. However, Object is a special case, since every Java class extends Object. You *can* have two protocols with the same method name, but they must be in *different* namespaces. Every protocol method *also* defines a function in the current namespace, so code like this: (ns foo.bar) (defprotocol Baz (theMethod [x])) (defprotocol Quux (theMethod [x])) Is defining the function foo.bar/theMethod *twice*. -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 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
Re: [PATCH] RFC: Add Functions `tabify` And `untabify`
On Fri, Jun 8, 2012 at 5:55 PM, OGINO Masanori masanori.og...@gmail.com wrote: There are many negative votes for the proposal and the main doubt is do you need to make them in closure.string? Hi Ogino, Please don't misinterpret my comments as saying you're wasting time. By all means, keep working on this. `tabify` and functions like it could be useful to others, I just don't know yet. If you can demonstrate an improvement to clojure.repl by adding these functions, then I think that's enough justification to add them -- maybe first as private fns in clojure.repl. Later on, if they seem generally useful, we can incorporate them into clojure.string. Thanks, -Stuart -- 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
Re: Is still idiomatic the ant simulation code?
The ants demo is definitely dated. It's not terrible, but the code could use some polishing/simplifying using newer additions to the language. -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 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
Re: [PATCH] RFC: Add Functions `tabify` And `untabify`
Seems like a fairly specialized function. No harm in including it where it's needed, but does it need to go in clojure.string? -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 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
Re: Deserialization of a Record
Can you post a standalone example that doesn't require seesaw? Otherwise it's hard to reproduce the problem. If the problem is class visibility on the EDT, there are a couple of possiblities: 1. Bind *use-context-classloader* to false in your event handler. This might work. 2. Have the event handler invoke a Clojure Agent to do the actual work. -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 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
Re: Why does (send a f) hang in this code, if f returns an agent?
I'm not sure why it hangs, but my guess is that your actions are throwing exceptions, breaking the loop and preventing the SynchronousQueue from ever being filled. By the way, the `time` you're measuring will dominated by `pprint`, not your actual test. -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 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
Re: [PATCH] RFC: Add Functions `tabify` And `untabify`
Stuart Halloway wrote: Whatever we do let's make sure we think about how to make it available in all Clojure dialects. Yes. When it comes to adding stuff to clojure.string, I'd like to focus less on adding single-purpose functions like dasherize and more on making sure that it's possible to *write* functions like dasherize in a platform-neutral way, that is, not relying on interop or particular features of the host platform (such as regex implementations). -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 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
Re: [PATCH] RFC: Add Functions `tabify` And `untabify`
On Fri, Jun 8, 2012 at 2:13 PM, Andy Fingerhut andy.finger...@gmail.com wrote: Are you concerned that there are differences in regex implementations between host platforms? Slightly. Or are you hoping that someone develops a portable-between-Clojure-hosts regex implementation and adds that to clojure.string? No. Definitely not. The point I was trying to make, gently, is this: what NEEDS to go to clojure.string and what can work just fine in an independent library? Ideally, additions to clojure.string should focus on the things you need in order to write functions like 'dasherize.' Let's get those done first, then it's easy to write a cross-platform string munging library containing things like dasherize, camel-case, etc. Once that library exists, and has been around long enough to stabilize, and has proven so essential that most Clojure programs end up needing it, THEN we can put it in clojure.string. -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 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
Re: Avoid duplicate computation in commute?
I think the point with `commute` is to allow for more concurrency at the expense of more computation. If you want assurance that your function is only called once, you can use `alter`. Keep in mind that *any* code in a Ref transaction has the potential to be called more than once if there's a conflict. All this doesn't mean that it's impossible to avoid the duplicate computation on `commute`. The code to study would be here: https://github.com/clojure/clojure/blob/8fda34e4c77cac079b711da59d5fe49b74605553/src/jvm/clojure/lang/LockingTransaction.java#L459 -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 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
Re: Assuring avalaibility of ring web apps
This is probably outside the scope of what Lein and Clojure do, but it's a well-studied problem for JVM apps. AWS itself has a variety of solutions, such as Elastic Beanstalk and Cloud Formation. At the OS-level, there's monit and its kin. -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 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
Re: does delay in calling clojure from java happen only once ?
Yes, Clojure has a runtime which is initialized the first time you call any Clojure code. The initialization never happens more than once. -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 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
Re: docstrings of if-let and when-let incorrect
How would multiple bindings for if-let or when-let work? Should every binding be testedd? Should they be and-ed together? Should it short-circuit if the first is false? I don't think there are obvious answers to those questions. -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 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
[ANN] ClojureScript release 0.0-1236
http://build.clojure.org/job/clojurescript-release/12/ Highlights: - Reducers - Dependencies on latest Google Closure Compiler and Library - Partial support for of data reader functions (tagged literals) -- 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
[ANN] New Google Closure Library JARs (incl third-party)
http://search.maven.org/#search%7Cga%7C1%7Cgoogle%20closure I have pushed out new releases of the Google Closure Library JARs. You can now get these dependencies directly from Maven Central: [org.clojure/google-closure-library 0.0-1376] [org.clojure/google-closure-library-third-party 0.0-1376] The third-party JAR contains the third-party extensions to the Google Closure Library. These are kept separate from the main library because they contain code ported from other projects under different licenses. ClojureScript does NOT depend on the third-party JAR; if you want to use it in your projects you must declare it explicitly. -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 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
Re: Idiomatic usage of partial
Every literal instance of `fn` or `#()` compiles to a new class definition. This is only at compile time: once the code is running, each execution of the `fn` expression merely creates an instance of that class. partial is implemented in terms of `fn`, so every usage of `partial` merely creates an instance of a class that already exists. So using `partial` instead of `fn` or `#()` saves a small amount of memory. -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 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
Request to create new contrib: data.dependency
As part of my long-delayed effort to get namespace dependency parsing into Contrib, I offer the clojure.data.dependency library: https://github.com/stuartsierra/data.dependency This is wholly my own work. I give permission to release it under the Clojure Contributor Agreement. -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 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
Re: defrecord serialization and *data-readers*
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 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
Re: docstrings of if-let and when-let incorrect
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 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