Re: tools.namespace.repl refresh is trying to refresh test dependencies we don't need

2014-03-23 Thread Stuart Sierra
I have encountered this problem as well. The simple fix is to remove the `checkouts` directory. I haven't found another way. -S On Friday, March 21, 2014 10:29:54 AM UTC-7, Christopher Poile wrote: Hi all, clojure.tools.namespace.repl/refresh tries to load (and run) the test files from

Test G.Closure lib release 0.0-20140226-71326067

2014-03-07 Thread Stuart Sierra
for details: https://groups.google.com/d/topic/closure-compiler-discuss/NXokuM4gpws/discussion https://groups.google.com/d/topic/closure-compiler-discuss/G9y8oUGnZ58/discussion Thanks, -Stuart Sierra -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: Defining test cases at runtime

2014-02-19 Thread Stuart Sierra
On Wednesday, February 19, 2014 2:14:52 PM UTC-5, John Wiseman wrote: I think I'd like to be able to define test cases at run-time. For example, I have some data files that define the tests I want to run (tuples of [program input, class name, program output]). I've looked at clojure.test and

Re: range-sum

2014-02-13 Thread Stuart Sierra
In the olden lisp days, reduce was often preferred to apply because apply could hit limits on the number of arguments that could be passed to a function. Is that a potential issue with clojure? No. Clojure's `apply` is lazy. Varargs are passed to the function as a lazy sequence, and it's up

Re: range-sum

2014-02-12 Thread Stuart Sierra
On Wednesday, February 12, 2014 8:46:41 AM UTC-5, Vincent wrote: On a slightly different topic: why reduce and not apply? The implementation of `+` with more than 2 arguments uses `reduce` internally. So they amount to the same thing. There isn't really a performance difference: user=

Re: unconditional append to end

2014-02-10 Thread Stuart Sierra
On Friday, February 7, 2014 7:20:09 PM UTC-5, t x wrote: Thus, my question: is there a builtin to _unconditinoally_ append to the end of a list/sequence/vector? Not built in. If you want things to grow at the end, you probably want vectors anyway. So try this: (defn conjv [coll item]

Re: range-sum

2014-02-06 Thread Stuart Sierra
I think (reduce + (range N)) is commonly used in **examples**, not necessarily in real applications. -S On Thursday, February 6, 2014 5:59:43 AM UTC-5, Jim foo.bar wrote: Hi all, I often see this code for summing up a range from 0-N : `(reduce + (range N))` However there is a much

Re: Help about using clojure in org mode in Emacs with CIDER

2014-01-28 Thread Stuart Sierra
On Thursday, January 23, 2014 2:04:22 AM UTC-5, Rui Yang wrote: Trying to use org mode with clojure. I'd like to use cider as the REPL server. Things is fine if I have only one statement in org source block. If I have more than one, then I got exception. Don't know if it's relevant or helpful

Re: [ANN] com.stuartsierra/frequencies 0.1.0

2014-01-26 Thread Stuart Sierra
That was a mistaken copy and paste. The release is [com.stuartsierra/frequencies 0.1.0] and is available on Clojars. -S On Sunday, January 26, 2014 4:05:24 PM UTC-5, Michael Klishin wrote: 2014-01-25 Stuart Sierra the.stua...@gmail.com javascript: Leiningen dependency

Re: What's your testing flow with the current clj tools?

2014-01-25 Thread Stuart Sierra
I use tools.namespace https://github.com/clojure/tools.namespace to cleanly reload all source files which have changed, then ` clojure.test/run-all-testshttp://clojure.github.io/clojure/clojure.test-api.html#clojure.test/run-all-tests` with a regex. -S On Saturday, January 25, 2014 12:57:23

[ANN] com.stuartsierra/frequencies 0.1.0

2014-01-25 Thread Stuart Sierra
New Clojure library frequencies https://github.com/stuartsierra/frequencies Basic statistical computations (mean, median, etc.) on **frequency maps**, e.g. the map returned by `clojure.core/frequencies`. A frequency map can represent (or approximate) a large distribution of values in a small

Re: avoiding repetition in ns declarations

2014-01-22 Thread Stuart Sierra
There's nothing built in to Clojure that does this, but you can easily define a function in one namespace that calls `require` for your other namespaces. Note that this may reduce readability of your source code if you forget exactly which namespaces that special function loads. -S -- --

Re: avoiding repetition in ns declarations

2014-01-22 Thread Stuart Sierra
On Wed, Jan 22, 2014 at 3:19 PM, t x txrev...@gmail.com wrote: (defn load-standard-requires [] (require ... ) (require ... )) ... Can either of you confirm this is the main plan of attack you have suggested? I don't actually *recommend* doing this. But it will work. My

Re: MyType cannot be cast to MyType?

2014-01-21 Thread Stuart Sierra
Hello Jonathan, In my experience, an error along the lines of class Foo cannot be cast to Foo is usually caused by re-evaluating class definitions, either by reloading files or by re-evaluating definitions in your REPL or IDE. Here is a smaller example that demonstrates the problem:

ANN: [org.clojure/data.json 0.2.4]

2014-01-10 Thread Stuart Sierra
*data.json: JSON parser and writer* https://github.com/clojure/data.json Version 0.2.4 Leiningen dependency info: [org.clojure/data.json 0.2.4] Changes in this release: * Small change in behavior: `clojure.data.json/pprint` now adds a newline after its output just like

ANN: [org.clojure/java.classpath 0.2.2]

2014-01-10 Thread Stuart Sierra
*java.classpath: examine the Java classpath from Clojure* https://github.com/clojure/java.classpath Version 0.2.2 Leiningen dependency info: [org.clojure/java.classpath 0.2.2] Changes in this release: * Enhancement [CLASSPATH-5]: extensible protocol to other classloaders

Re: recursion in clojure.walk

2014-01-09 Thread Stuart Sierra
I wrote clojure.walk, but I don't usually recommend it for anything but casual use. clojure.walk very general, so it's not going to be the most efficient approach. When you know more details about the data structure you're working with, as in this case, you can make something that will be

Re: [ANN] Component: dependency injection and state management

2014-01-05 Thread Stuart Sierra
, or mock/stub out the call to execute-query, or the call to get-user itself. Is there something I'm missing? Is there some way you could/would do this with the component library? Or is this not the point of the library? - Korny On 21 November 2013 02:01, Stuart Sierra the.stuart.sie

[ANN] component 0.2.1

2013-12-19 Thread Stuart Sierra
Component: object lifecycle management dependency injection https://github.com/stuartsierra/component Version 0.2.1. in Leiningen: [com.stuartsierra/component 0.2.1] Changes in this release: * Conveniences * Added arities to `start-system` and `stop-system` * Generic `system-map` for

Re: exporting imported symbols

2013-12-01 Thread Stuart Sierra
Not supported. This is a feature. As long as you use `:require :as` or `:require :refer`, you can always tell where a symbol comes from. -S On Sunday, December 1, 2013 10:10:46 AM UTC-5, Dave Tenny wrote: (ns mine (:use foo)) ; has public symbol bar What is the proper use/require/refer

Re: [ANN] Component: dependency injection and state management

2013-11-21 Thread Stuart Sierra
On Thursday, November 21, 2013 7:22:10 AM UTC-5, abp wrote: Why do you prefer declaring dependencies between components of a system explicitly instead of using prismatics Graph? 'Graph' by itself does not preserve the dependency relationships after constructing the map. But the two approaches

[ANN] Component: dependency injection and state management

2013-11-20 Thread Stuart Sierra
This is a small library/framework I've been working on for a few months. https://github.com/stuartsierra/component I use this to manage runtime state in combination with my reloaded workflow using tools.namespace.[1] I've started using this on some personal and professional projects and it

[ann] class-diagram 0.1.0: utility to generate class inheritance diagrams

2013-10-01 Thread Stuart Sierra
*class-diagram:* a little utility to generate Java class inheritance diagrams from the REPL. Version 0.1.0, first release Source, README, and examples: https://github.com/stuartsierra/class-diagram Leiningen dependency info: [com.stuartsierra/class-diagram 0.1.0] License: EPL -- -- You

Re: API management in Clojure

2013-10-01 Thread Stuart Sierra
For timeouts, error-handling, and thread isolation, take a look at Netflix's Hystrix: https://github.com/Netflix/Hystrix/tree/master/hystrix-contrib/hystrix-clj On Monday, September 30, 2013 11:46:03 PM UTC-4, Mikera wrote: I'm curious about the options for managing APIs in Clojure code in a

Re: 1.6 alpha?

2013-09-30 Thread Stuart Sierra
You can also get regular SNAPSHOT builds of Clojure from the Sonatype OSS repository. Instructions here: http://dev.clojure.org/display/community/Maven+Settings+and+Repositories -S On Monday, September 30, 2013 5:00:17 PM UTC-4, Andy Fingerhut wrote: I am not aware of any 1.6 alpha/beta

ANN: data.json 0.2.3

2013-08-30 Thread Stuart Sierra
*data.json*: pure-Clojure JSON parser/writer Info and docs: https://github.com/clojure/data.json New release version: *0.2.3* In Leiningen: [org.clojure/data.json 0.2.3] Changes in this release: * Enhancement DJSON-9 http://dev.clojure.org/jira/browse/DJSON-9: option to escape U+2028

Re: tools for minimizing forward declaration

2013-08-16 Thread Stuart Sierra
Forward declarations are rarely necessary in my experience: you just get used to defining your namespaces with low-level primitive functions at the top and higher-level functions at the bottom. You only need forward declarations (`declare`) in cases of mutual recursion, i.e. two functions that

ANN: ClojureScript 0.0-1847

2013-07-24 Thread Stuart Sierra
ClojureScript, the Clojure compiler that emits JavaScript source code. README and source code: https://github.com/clojure/clojurescript New release version: 0.0-1847 Leiningen dependency information: [org.clojure/clojurescript 0.0-1847] *Changes: *The only changes since the last release

Re: Can't get namespace metadata

2013-07-23 Thread Stuart Sierra
I can confirm this behavior. It's not the fault of the `ns` macro, however. This works just fine: user= (ns ^{:doc This is foo} foo) nil foo= (in-ns 'user) #Namespace user user= (meta (the-ns 'foo)) {:doc This is foo} AOT-compilation appears to be the culprit (as usual).

Re: ns defaults

2013-07-19 Thread Stuart Sierra
On Thursday, July 18, 2013 4:34:49 AM UTC-4, Jozef Wagner wrote: Compiler loads and refers clojure.core namespace for each new namespace. In my projects, I often have one or two namespaces I use nearly in every other namespace. (e.g. clojure.tools.logging or clojure.string). It would be

Re: ns defaults

2013-07-19 Thread Stuart Sierra
On Fri, Jul 19, 2013 at 3:03 PM, Jozef Wagner jozef.wag...@gmail.comwrote: Yes, but this seems to work only in Clojure, not in ClojureScript. That's true. -S -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

[ANN] tools.namespace 0.2.4

2013-07-19 Thread Stuart Sierra
*tools.namespace:* utilities to search for, parse, move, and reload namespaces with awareness of their dependencies Release 0.2.4: bug fixes only README and source code: https://github.com/clojure/tools.namespace Leiningen dependency information: [org.clojure/tools.namespace 0.2.4]

Re: Importing another data_readers

2013-07-19 Thread Stuart Sierra
When Clojure starts it will search for files named data_readers.clj at the root the Java classpath. Every library JAR can have its own data_readers.clj and they will all be loaded and merged. Be careful with this: if there's a conflict in data reader bindings, Clojure won't start. If your

Re: Clojure generates unnecessary and slow type-checks

2013-07-02 Thread Stuart Sierra
Hi Jim, I cannot reproduce your results. I see Clojure and Java with similar performance when they are both using java.lang.BigInteger. Clojure's arbitrary-precision integer defaults to clojure.lang.BigInt, which in my test is about 12% slower than java.lang.BigInteger. See

Re: Clojure generates unnecessary and slow type-checks

2013-06-19 Thread Stuart Sierra
Jason Wolfe wrote: We thought we were being very careful Sorry, didn't mean to imply that you weren't. ;) It was me who wasn't careful: when I started investigating this, I used a dead-code loop similar to the Gist I posted, which made it look like Clojure 1.2 was much faster than 1.5. I

Re: Clojure in production

2013-06-19 Thread Stuart Sierra
Hi Plínio, At Relevance, we use Clojure on many consulting projects for clients ranging from small startups to Fortune-500 companies. Datomic, a database, is written primarily in Clojure. http://thinkrelevance.com/ http://datomic.com/ http://clojure.com/ Good luck with your talk. Thanks, -S

Re: Clojure generates unnecessary and slow type-checks

2013-06-18 Thread Stuart Sierra
One has to be very careful with this kind of micro-benchmarking on the JVM. Dead-code elimination can easily make something seem fast simply because it's not doing anything. For example, in Java: https://gist.github.com/stuartsierra/5807356 Being careful not to have dead code, I get about the

Re: Clojure generates unnecessary and slow type-checks

2013-06-18 Thread Stuart Sierra
For the record, it was Rich who discovered, and told me, that Leiningen was adding extra JVM args. :) -S On Tuesday, June 18, 2013 2:29:00 PM UTC-4, Jason Wolfe wrote: The good news is that Stuart Sierra nailed the problem above -- -- You received this message because you are subscribed

Re: Clojure generates unnecessary and slow type-checks

2013-06-18 Thread Stuart Sierra
Great. Glad we found it! Since this was so confusing, I've filed an issue with Leiningen to make :jvm-opts in a project.clj override any Leiningen defaults: https://github.com/technomancy/leiningen/pull/1230 -S -- -- You received this message because you are subscribed to the Google Groups

Re: type-hints positioning convention?

2013-06-17 Thread Stuart Sierra
I don't know what core.contrib.strutils2 is, but it sounds like old contrib pre-clojure-1.3. See http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go The type-hints-before-the-argument-vector syntax was introduced in Clojure 1.3 along with primitive type hints, so I would consider

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

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

Re: Utility libraries and dependency hygiene

2013-06-06 Thread Stuart Sierra
puzzler wrote: I decided it would be a bad idea to include rhizome directly in instaparse's dependencies. Nevertheless, it made sense to enable the visualize function *provided* rhizome was already in the user's dependencies. I prefer to avoid these kinds of load-time tricks, as they break

Re: NullPointerException when creating protocol in macro

2013-06-05 Thread Stuart Sierra
Hi Vincent, `defprotocol` is a top-level form, not really meant to be mixed with value-returning expressions like `fn`. Protocols are always global because of how they compile into Java interfaces. Here's one way to make it work, by defining a symbol instead of returning a function:

Re: NullPointerException when creating protocol in macro

2013-06-05 Thread Stuart Sierra
On Wed, Jun 5, 2013 at 7:35 PM, Colin Fleming colin.mailingl...@gmail.comwrote: Given this, are there any forms that are genuinely top-level from the compiler's point of view? It's never explicitly enforced, just a consequence of how the compiler creates and loads Java classes. Generally,

Re: [ANN] lein-pedantic is now deprecated

2013-05-31 Thread Stuart Sierra
Hi Nelson, thanks for making lein-pedantic. It has been useful to us. Happy to see it built in to Leiningen! -S On Wednesday, May 29, 2013 9:25:22 PM UTC-4, Nelson Morris wrote: Good news everybody! As of leiningen 2.2.0 using `lein deps :tree` will perform version checks and version range

Re: Idiomatic way to write dependency resolving algorithms?

2013-05-31 Thread Stuart Sierra
If you're curious to see alternatives, I wrote a basic dependency graph library based on Clojure's hierarchy implementation. It's part of tools.namespace: https://github.com/clojure/tools.namespace/blob/tools.namespace-0.2.3/src/main/clojure/clojure/tools/namespace/dependency.clj Or also

Re: Getting highlighted clojure code into a presentation

2013-05-18 Thread Stuart Sierra
I wrote my own tool (in ClojureScript) to present Emacs org-mode's HTML export as slides. It's pretty clunky too, but works for code-heavy presentations. https://github.com/relevance/org-html-slideshow -S On Saturday, May 18, 2013 1:42:55 PM UTC+10, Korny wrote: Hi folks - I had to prepare

Re: Utility libraries and dependency hygiene

2013-05-15 Thread Stuart Sierra
On Wed, May 15, 2013 at 11:35 PM, Michael Fogus mefo...@gmail.com wrote: Are Common Lispers actively suffering under this problem? I certainly suffered from it back when I used Common Lisp. Every library was written in its own dialect of CL based on a different set of these utilities. It made

Re: Utility libraries and dependency hygiene

2013-05-15 Thread Stuart Sierra
or 2 functions. Given the dependency management tools we have right now, this will make life easier for users of your library. Thanks, -S On Mon, May 13, 2013 at 9:29 AM, Stuart Sierra the.stuart.sie...@gmail.comwrote: Based on a recent thread about utility libraries, I would like to take

Re: idiomatic terminating infinite loops

2013-05-15 Thread Stuart Sierra
Colin Yates wrote: I have a scheduler which creates a future that basically does a (while true (let [next-job (.take queue)]...)), where queue is a LinkedBlockingQueue. The problem is that once it is running, because futures aren't daemon threads it hangs lein. Instead of .take, you can use

Re: Utility libraries and dependency hygiene

2013-05-15 Thread Stuart Sierra
On Thu, May 16, 2013 at 8:51 AM, Laurent PETIT laurent.pe...@gmail.comwrote: How is the advice of each library re-creating for itself little utility functions, again and again, going to address the specific concern of made it hard to read code written by anyone else ? If the functions are

Re: Utility libraries and dependency hygiene

2013-05-13 Thread Stuart Sierra
On Mon, May 13, 2013 at 12:55 PM, Mikera mike.r.anderson...@gmail.comwrote: Maybe we could try to develop towards some kind of lightweight dependency loading system that avoids this problem? I believe lightweight dependency loading system is an oxymoron. Either you A) design a new module

Re: Utility libraries and dependency hygiene

2013-05-13 Thread Stuart Sierra
On Tue, May 14, 2013 at 3:25 AM, Phil Hagelberg p...@hagelb.org wrote: It's really not difficult to do if you limit yourself to Clojure since Clojure namespaces are first-class and easy to manipulate at run-time. We implemneted a prototype of this in under two hours at a Seajure meeting a

Re: Understanding boxing

2013-05-13 Thread Stuart Sierra
On Tuesday, May 14, 2013 5:36:53 AM UTC+10, puzzler wrote: What tools exist in Clojure for understanding whether a given variable is boxed or primitive? The REPL will always box things, making it difficult to use for understanding primitives. If you want to be 100% sure, AOT-compile your code

Re: Clojure performance measuring

2013-05-12 Thread Stuart Sierra
We've found YourKit (a commercial product) to be helpful. -S On Sunday, May 12, 2013 2:46:52 AM UTC+10, Jonathon McKitrick wrote: If I cannot get New Relic to work, I'm going to stick to my development platform for initial optimization and memory troubleshooting. What tools do you

Utility libraries and dependency hygiene

2013-05-12 Thread Stuart Sierra
Based on a recent thread about utility libraries, I would like to take this opportunity to ask everyone to help us avoid the dependency mess that Common Lisp has gotten into, where there are over a dozen such convenience libraries[1]. By all means, use these libraries in your *applications* if

Re: Utility libraries and dependency hygiene

2013-05-12 Thread Stuart Sierra
Isolated dependency loading is not possible in the JVM without complex ClassLoader-based schemes like OSGI, which come with their own set of problems. -S On Mon, May 13, 2013 at 9:45 AM, Angel Java Lopez ajlopez2...@gmail.comwrote: Node.js + NPM (its package manager) has a nice version

Re: Quick question on protocols

2013-05-10 Thread Stuart Sierra
When you extend a protocol to multiple Java interfaces / abstract classes, then call the methods on an instance which implements/extends more than one of those, the result is *undefined*. The problem is that this permits multiple inheritance of concrete behavior, the reason Java doesn't allow

Re: merge nested maps

2013-04-28 Thread Stuart Sierra
Yes. On Sun, Apr 28, 2013 at 4:55 AM, Gary Verhaegen gary.verhae...@gmail.comwrote: Shouldn't that docstring read If vals are not maps ? On 25 April 2013 23:26, Stuart Sierra the.stuart.sie...@gmail.com wrote: Here's a way to do it from the Pedestal demo source code: (defn deep-merge

Re: Something like cond, but with test-fns

2013-04-28 Thread Stuart Sierra
You could do it with `condp`: (condp #(%1 %2) value foo-pred? (foo-result) bar-pred? (bar-result) else? (default-result)) -S On Saturday, April 20, 2013 5:15:14 AM UTC-4, Ken Scambler wrote: Hi there, I'm getting started with Clojure, and found myself really missing Scala-style

Re: merge nested maps

2013-04-25 Thread Stuart Sierra
Here's a way to do it from the Pedestal demo source codehttps://github.com/pedestal/demo/blob/17eeac7a5e50d31eb81901de465f3f1d863f2f01/hammock-cafe/src/hammock_cafe/config.clj#L37 : (defn deep-merge Recursively merges maps. If keys are not maps, the last value wins. [ vals] (if (every?

Re: Performance of calling primitive type hinted functions passed as arguments

2013-04-24 Thread Stuart Sierra
I'm taking a guess here: The compiler doesn't know the type signature of `cb` when compiling `foo`, so it's going to use the IFn.invoke(Object) signature. Clojure's type inference is only local, and it won't assume that a primitive-type signature is available for an arbitrary function. So

Re: Hacker News, Clojure, and GSOC

2013-04-17 Thread Stuart Sierra
On Wednesday, April 17, 2013 3:27:59 AM UTC-4, da...@axiom-developer.org wrote: Does anyone know anyone associated with Hacker News? Can we clue them into immutable data structures? I know that Hacker News is mostly written by Paul Graham in Arc [1], his personal dialect of Lisp. As

Re: Namespaces, APIs, protocols and records

2013-04-15 Thread Stuart Sierra
...talk by Stuart Sierra (http://vimeo.com/46163090) in which he suggests putting protocols and their implementations in separate namespaces, because, during development reloading a protocol breaks existing instances I don't universally recommend this any more. You still have

[ANN] dependency graph library 0.1.0

2013-04-07 Thread Stuart Sierra
https://github.com/stuartsierra/dependency In Leiningen: [com.stuartsierra/dependency 0.1.0] Some of you may have seen the dependency graph structure I used in tools.namespace https://github.com/clojure/tools.namespace. This library contains that same structure, available for applications

[ann] data.json 0.2.2

2013-04-07 Thread Stuart Sierra
https://github.com/clojure/data.json In Leiningen: [org.clojure/data.json 0.2.2] This is a bug fix release which resolves DJSON-7http://dev.clojure.org/jira/browse/DJSON-7and DJSON-8 http://dev.clojure.org/jira/browse/DJSON-8. -- -- You received this message because you are subscribed to

[ann] tools.namespace 0.2.3

2013-04-01 Thread Stuart Sierra
Clojure-contrib library tools.namespace release 0.2.3 now available in the Maven Central repository. In Leiningen: [org.clojure/tools.namespace 0.2.3] On GitHub: https://github.com/clojure/tools.namespace Changes in this release: * In the event of an error while reloading,

Re: Problem installing Pedestal libraries

2013-03-28 Thread Stuart Sierra
Pedestal is tested with Leiningen 2.0.0, final release. Try upgrading from a preview version. You can also get more direct Pedestal support at https://groups.google.com/d/forum/pedestal-users -S On Tuesday, March 26, 2013 8:54:41 PM UTC-4, Jan Herich wrote: Hello, I have little problem

Re: Redefinition of datatypes

2013-03-24 Thread Stuart Sierra
Ah yes, the joys of AOT-compilation and static initializers. I know them well. Strange things happen with AOT-compilation. Classes get loaded in a different order, or get loaded by different classloaders. Maybe someday we can figure it all out. Try replacing that with `instance?` as you say.

Re: Moving ClojureScript to Clojure 1.5.0 data.json dependency

2013-03-12 Thread Stuart Sierra
No issue from me. Just make sure you get the right version of data.json: 0.2.0 was a bad release. Use 0.2.1. -S On Friday, March 1, 2013 2:41:26 PM UTC-5, David Nolen wrote: Now that Clojure 1.5.0 is out the door I'd like to make ClojureScript depend on it. This would allow me to merge in

Re: fold over a sequence

2013-03-12 Thread Stuart Sierra
Hi Paul, This might be an interesting contribution to clojure.core.reducers. I haven't looked at your code in detail, so I can't say for sure, but being able to do parallel fold over semi-lazy sequences would be very useful. -S On Tuesday, March 12, 2013 9:34:43 AM UTC-4, Paul Butcher

Re: nameclashes with java.lang

2013-03-12 Thread Stuart Sierra
Actually, simply creating a namespace imports all of java.lang. The `ns` macro is responsible only for referring clojure.core. That's been true since 1.0. The only workaround right now is ns-unmap. -S On Wednesday, March 6, 2013 8:33:34 AM UTC-5, Jim foo.bar wrote: On 06/03/13 10:41,

Re: lazy seqs overflow the stack?

2013-03-12 Thread Stuart Sierra
Yes. `concat` in a loop is tricky: each additional concatenation creates a new lazy sequence object which points to the previous lazy sequence. If you get too many of those, trying to realize the lazy sequence will cause a stack overflow. In general, I recommend using `concat` only in

Re: fold over a sequence

2013-03-12 Thread Stuart Sierra
See clojure.org/contributing it's all there. On Tuesday, March 12, 2013, Paul Butcher wrote: On 12 Mar 2013, at 18:26, Stuart Sierra the.stuart.sie...@gmail.comjavascript:_e({}, 'cvml', 'the.stuart.sie...@gmail.com'); wrote: This might be an interesting contribution

Re: nREPL + Emacs: How to get new definitions to load reliably?

2013-02-23 Thread Stuart Sierra
know if that helps. Thanks, -S On Thu, Feb 21, 2013 at 3:23 PM, Karl Smeltzer karl.smelt...@gmail.comwrote: Thanks for that helper function. I suppose that's as close as I'll get for the time being. On Thu, Feb 21, 2013 at 6:03 AM, Stuart Sierra the.stuart.sie...@gmail.com wrote

Re: Redefinition of datatypes

2013-02-23 Thread Stuart Sierra
Hi Ambrose, I would try to help diagnose this, but I can't even try to compile core.typed in its present state because of dependencies: core.typed declares a dependency on analyze 0.3.1-SNAPSHOThttps://github.com/clojure/core.typed/blob/78d09859cee78967e9dd0ee7d74e0f52bd3be6f1/project.clj#L3,

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

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

Re: nREPL + Emacs: How to get new definitions to load reliably?

2013-02-21 Thread Stuart Sierra
For what it's worth, I tried using tools.namespace but if I (refresh) code that doesn't compile, then suddenly the refresh symbol is out of scope and I'm back to square one. You can still recover from this: just call 'refresh' by its fully-qualified name:

[ANN] ClojureScript release 0.0-1586

2013-02-16 Thread Stuart Sierra
Coming soon to a Maven repository near you: [org.clojure/clojurescript 0.0-1586] List of changes: http://build.clojure.org/job/clojurescript-release/22/ Notable change: fix for CLJS-418, the broken dependency chain between the Google Closure Library and its third-party extensions.

Re: abstraction on two libraries

2013-02-16 Thread Stuart Sierra
Yeah, it's not worth the effort. IF you were going to attempt it, you'd want to define a protocol (or multimethods) for the common features that both libraries provide, then provide different implementations of those protocols using each library. But what's the point, especially if they both

Re: Library naming etiquette?

2013-02-13 Thread Stuart Sierra
Please use a groupId (your name or domain name). For example, Friend: https://github.com/cemerick/friend/blob/master/project.clj#L1 -S On Tuesday, February 12, 2013 7:51:44 PM UTC-5, Jim Klucar wrote: I have a library that I'm getting ready to push to github / clojars and had a question

Re: String wrapper that supports meta-data...

2013-01-27 Thread Stuart Sierra
On Wednesday, January 9, 2013 4:23:06 PM UTC-5, Jim foo.bar wrote: hehehe...I'm really stupid aren't I?:-[ Not at all. :) It takes time to get used to all the different ways things can be used, for example the fact that records support metadata. -S -- -- You received this message

[ANN] java.classpath 0.2.1

2013-01-18 Thread Stuart Sierra
On its way to a Maven repository near you (within 24 hours): [org.clojure/java.classpath 0.2.1] Changes: - Fixed http://dev.clojure.org/jira/browse/CLASSPATH-4 -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: clojure.core/ns documentation glitch?

2013-01-10 Thread Stuart Sierra
yes On Wednesday, January 9, 2013 11:32:41 AM UTC-5, wujek@gmail.com wrote: The documentation of clojure.core/ns says nearly to the end of its docstring: If :refer-clojure is not used, a default (refer 'clojure) is used. Shouldn't it say that a default (refer 'clojure.core) is used?

Re: What's the current status of Clojure-in-Clojure?

2013-01-09 Thread Stuart Sierra
There is no official work (i.e., happening under the Clojure Contributor Agreement) on Clojure-in-Clojure. ClojureScript is as close as it gets right now. -S On Tuesday, January 8, 2013 6:44:16 PM UTC-5, Thor wrote: I think this would be a fun project to contribute to, but a few searches

Re: All the ways to define metadata (and ^:static)

2013-01-09 Thread Stuart Sierra
4. what does ^:static do? Nothing. It's leftover from an old experiment in the Clojure compiler. -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

Re: String wrapper that supports meta-data...

2013-01-09 Thread Stuart Sierra
You could also do: (defrecord MString [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.

Re: Copying (immigrating) macros from namespace to namespace

2013-01-06 Thread Stuart Sierra
I've said it before and I will keep saying it: copying symbols by interning vars breaks the identity of the original vars. It breaks dynamic binding, with-redefs, and the ability to redefine functions at the REPL. Clojure has a two perfectly good mechanisms for making vars available in other

Re: limit keys from client JSON (select-keys but nested?)

2013-01-01 Thread Stuart Sierra
data.json 0.2.x allows transformation functions to be applied to data as it is read in. http://clojure.github.com/data.json/#clojure.data.json/read -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Use repeat with a function argument

2012-12-25 Thread Stuart Sierra
`repeat` takes a value and returns a sequence of that value. There's another function, `repeatedly`, which takes a function and returns a sequence of values returned by calling that function. -S -- You received this message because you are subscribed to the Google Groups Clojure group. To

Re: Clojure 1.5.0 RC 1

2012-12-23 Thread Stuart Sierra
On Sunday, December 23, 2012 1:11:31 PM UTC-5, JSchmitt wrote: I have tried to build a RPM package of clojure-1.5.0-RC1 for Feodra and have got the following error message: test: [java] Exception in thread main java.io.FileNotFoundException: Could not locate

Re: reader literal , tagged literal

2012-12-22 Thread Stuart Sierra
yes On Saturday, December 22, 2012 12:03:00 PM UTC-5, John Gabriele wrote: Are reader literals the same thing as tagged literals? (It appears that the Clojure 1.4 changes.md file refers to them as reader literals, but http://clojure.org/reader calls them tagged literals.) Thanks,

Re: clojure defining a var with a dot in the name is accepted in clojure 1.5-RC1, but probably shouldn't?

2012-12-22 Thread Stuart Sierra
On Saturday, December 22, 2012 3:34:52 PM UTC-5, Borkdude wrote: Clojure lets me define a var which name contains a dot, but I can't dereference it by name (because it is seen as a classname with a method or field). Clojure shouldn't let me let define it in the first place I think? It all

Re: clojure defining a var with a dot in the name is accepted in clojure 1.5-RC1, but probably shouldn't?

2012-12-22 Thread Stuart Sierra
Actually it's clojure.lang.Compiler/maybeResolveIn responsable for that Of course. I meant the compiler, not the reader. ;) -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

Re: [ANN] tools.namespace 0.2.2 and Flow 0.1.0

2012-12-21 Thread Stuart Sierra
On Tuesday, December 18, 2012 1:02:55 AM UTC-5, Mikera wrote: Re: tools.namespace, I've found some similar functions in the bultitude library (https://github.com/Raynes/bultitude/tree/master/src/bultitude). Apparently it addresses specific needs that clojure.tools.namespace did not

[ANN] tools.namespace 0.2.2 and Flow 0.1.0

2012-12-14 Thread Stuart Sierra
tools.namespace (a Clojure contrib library): Tools for managing reloading namespaces. Changelog more info: https://github.com/clojure/tools.namespace Leiningen dependency: [org.clojure/tools.namespace 0.2.2] Flow (non-contrib, EPL): Building up computations out of dependency

Re: Injecting new clojure.core functions into third-party libraries

2012-12-14 Thread Stuart Sierra
`in-ns` is special. To create Vars in another namespace, use `intern` instead of `defn`. -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 -

Re: Flow Q (Re: [ANN] tools.namespace 0.2.2 and Flow 0.1.0)

2012-12-14 Thread Stuart Sierra
FrankS wrote: Does Flow work with ClojureScript? I haven't tried. In principle, there's no reason why it couldn't. It uses macros, so it would require some porting. It feels like expressing and using those Flows could solve similar call-back-hell problem in the single-threaded asynchronous

Re: Default random in Clojure doesn't seem to fit fp paradigm

2012-12-06 Thread Stuart Sierra
The data.generators library has versions of these functions that use a fixed seed and a rebindable Random instance. https://github.com/clojure/data.generators -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Promise for ClojureScript?

2012-11-26 Thread Stuart Sierra
I've been working on a promises API with callbacks for Clojure (JVM): http://dev.clojure.org/display/design/Promises If I can get buy-in and support for implementing this as a language-level feature in Clojure, the obvious next step would be to port it to ClojureScript. -S -- You received

<    1   2   3   4   5   6   7   8   9   10   >