Why the CLR languages fail?

2013-06-05 Thread Zed Becker
Why do the languages running on the CLR (ironRuby, ironPython, ironScheme, ScalaCLR) do not get to live long enough in the sunshine, whereas same languages get embraced by the Java runtime, and live in the limelight? Chas did a survey in 2012, which gave very negative results for clojureCLR, w

Re: [ANN] alpacas: a new Clojure source viewer

2013-06-05 Thread John Gabriele
On Wednesday, June 5, 2013 10:34:35 AM UTC-4, Laurent PETIT wrote: > > tl;dr: when should I prefer LGPL over EPL for a Clojure lib ? > Have a look at the brief summary at http://docs.python-guide.org/en/latest/writing/license.html . If you care more about item #2 on that 2-item list, then you

[ANN] edn-java 0.4.1 released

2013-06-05 Thread Ben Smith-Mannschott
edn-java [1] is a parser and printer for edn [2]. This release fixes issue31 [3] "single quote in a string is incorrectly escaped". It is available on Maven Central [4]. // Ben [1] http://edn-java.bpsm.us [2] https://github.com/edn-format/edn [3] https://github.com/bpsm/edn-java/issues/31 [4] h

Re: Making things go faster

2013-06-05 Thread Mikera
My setup is usually: - Eclipse with Counterclockwise plugin - Keep an open, running REPL at all times - Reload namespaces when necessary (Ctrl+Alt+L) - Run tests with clojure.test from the REPL This avoids the startup overhead most of the time - I usually only use the Maven / leiningen comma

Re: Making things go faster

2013-06-05 Thread Brian Marick
On Jun 4, 2013, at 11:16 PM, Kevin Downey wrote: > midje makes each test a top level form, so test runs happen as a side effect > of code loading, which means you cannot really run tests in a good way from > the repl without doing some kind of ridiculous forced code reloading. I would > defin

Re: Making things go faster

2013-06-05 Thread Brian Marick
On Jun 4, 2013, at 11:16 PM, Kevin Downey wrote: > midje makes each test a top level form, so test runs happen as a side effect > of code loading, which means you cannot really run tests in a good way from > the repl without doing some kind of ridiculous forced code reloading. I would > defin

Re: Making things go faster

2013-06-05 Thread Brian Marick
On Jun 4, 2013, at 3:51 PM, David Pollak wrote: > * Is there a faster cycle than to change code, change tests and type "lein > test" to see the results? I use Midje in a repl. That looks like this: % lein repl (use 'midje.repl) (autotest) When I save a source or test file, the relevant

Re: lein clojars plugin and latest version of leiningen

2013-06-05 Thread Phil Hagelberg
On Jun 5, 2:54 pm, Mark Engelberg wrote: > So. is this a new change that puts it into the "provided" subdirectory of > target?  If so, what's the easiest way to get "lein push" working again? Yeah, you can set :target-path in project.clj to just "target" to get the old behaviour. AFAIK `lein pus

Re: NullPointerException when creating protocol in macro

2013-06-05 Thread Softaddicts
Legal but comparable to a hidden side effect with all the pitfalls that can derive from this. It's not a compiler issue, more a discipline issue. Having a helper macro like Stuart suggest is acceptable to me if it's called at top level, it's always done. There's less ambiguity. Using def/defn i

Re: NullPointerException when creating protocol in macro

2013-06-05 Thread Stuart Sierra
On Wed, Jun 5, 2013 at 7:35 PM, Colin Fleming wrote: > 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, the things which compile dir

Re: NullPointerException when creating protocol in macro

2013-06-05 Thread Colin Fleming
*`defprotocol` is a top-level form...* This is interesting, and it's something I've wondered about. As far as I can tell, there's really no distinction between top-level forms and other forms, for example this is legal and works: (defn define-my-functions [] (defn test-1 [] 1) (defn test-

Re: [ANN] alpacas: a new Clojure source viewer

2013-06-05 Thread Colin Fleming
Interesting, I think I like this presentation better, I found the explicit boxes in the OP a little distracting. I guess this then becomes more like Python-style significant indentation, which might be an interesting approach too. On 5 June 2013 12:15, Matthew Chadwick wrote: > hehe looks simil

Re: [ANN] alpacas: a new Clojure source viewer

2013-06-05 Thread Colin Fleming
Right, FWIW in my previous company we disallowed LGPL libraries because of the clause that explicitly allows reverse engineering to substitute different versions of the library. Of course, it's unlikely that anyone would ever do this but it would be a support nightmare if they did, so it was just e

Re: Utility libraries and dependency hygiene

2013-06-05 Thread Mark Engelberg
This thread came up right around the time I was considering adding a dependency on rhizome to instaparse to make it easy to visualize the parse trees. Based on the discussion here, I decided it would be a bad idea to include rhizome directly in instaparse's dependencies. Nevertheless, it made sen

Re: parsing xml with zip, xml and clojure.data.zip

2013-06-05 Thread Ryan Moore
Ahh, so if the var refers to the root that would explain why specifying the root never returns anything. Thanks. On Wednesday, June 5, 2013 11:54:49 AM UTC-4, Stefan Kamphausen wrote: > > AFAIK your var myxml already refers to the root node of your XML > document. > > So your first example sea

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: (defmacro

lein clojars plugin and latest version of leiningen

2013-06-05 Thread Mark Engelberg
I've been using the lein clojars plugin to deploy to clojars with the "lein push" command. It's been working great for me, but today, it's not working. I recently upgraded to the newest version of leiningen, and that's the only major change I can think of since my last deployment, so I'm speculat

Re: [ANN] alpacas: a new Clojure source viewer

2013-06-05 Thread Lee Spector
On Jun 4, 2013, at 4:13 PM, Andrea Chiavazza wrote: > Alpacas is an application that displays Clojure source code with forms shown > as nested boxes, doing away with parenthesis altogether. FWIW somewhat related ideas go back a couple of decades. Some pointers can be found at http://www.cs.umd

Re: importing a java class which 'requires' your namespace in a static block

2013-06-05 Thread Marshall Bockrath-Vandegrift
"Jim - FooBar();" writes: > Now, the first time I (load-file "xxx.core.clj") everything is > perfectly fine. The minute I make a change and re-load I get: > > NoClassDefFoundError Could not initialize class yyy.Foo This confuses me, because the JVM should only be loading and initializing the Jav

Re: Making things go faster

2013-06-05 Thread Alan Thompson
Nice summary on the blog. Might I suggest one small improvement? How about: (do (use 'plugh.file-test :reload-all) (run-tests) ) Then, just a single sequence. :) Alan Thompson P.S. I'm still working on getting GVIM+fireplace set up, which should allow me to do everything from within the ed

Re: importing a java class which 'requires' your namespace in a static block

2013-06-05 Thread Softaddicts
The other alternative is to extend the class loader to add a trap. I do not have the code handy but you might find it using a search on google. Luc > One problem with doing this in a static initializer is that you lose the > relevant exception. I would try moving this to a constructor or lazy-

Re: importing a java class which 'requires' your namespace in a static block

2013-06-05 Thread Jim - FooBar();
On 05/06/13 18:40, Gary Trakhman wrote: One problem with doing this in a static initializer is that you lose the relevant exception. I would try moving this to a constructor or lazy-load it, and you might get a better error message. doing what you suggested seems to alleviate the problem! I'm

Re: importing a java class which 'requires' your namespace in a static block

2013-06-05 Thread Gary Trakhman
One problem with doing this in a static initializer is that you lose the relevant exception. I would try moving this to a constructor or lazy-load it, and you might get a better error message. On Wed, Jun 5, 2013 at 1:28 PM, Jim - FooBar(); wrote: > Hello everyone, > > weirdness strikes again!

importing a java class which 'requires' your namespace in a static block

2013-06-05 Thread Jim - FooBar();
Hello everyone, weirdness strikes again! I've got the following situation: - a namespace core.clj which imports a java class, let's call it Foo.java - Foo.java requires core.clj in the usual way : private static IFn requireFn = RT.var("clojure.core", "require").fn(); static { req

Re: parsing xml with zip, xml and clojure.data.zip

2013-06-05 Thread Stefan Kamphausen
AFAIK your var myxml already refers to the root node of your XML document. So your first example searches for a tag called "level1" inside the root tag (which is "level1"). Obviously, there is no such node and the text is empty. Your second example extracts a textual representation of the ch

Re: [ANN] alpacas: a new Clojure source viewer

2013-06-05 Thread David Powell
Personally, I think there is too much guesswork involved in understanding what the LGPL means re Java. For example, from http://jtds.sourceforge.net/license.html, a Java library: Using jTDS is considered to be dynamic linking; hence our interpretation of > the LGPL is that the use of the unmodifi

Re: parsing xml with zip, xml and clojure.data.zip

2013-06-05 Thread gaz jones
This may help: http://clojure-doc.org/articles/tutorials/parsing_xml_with_zippers.html On Wed, Jun 5, 2013 at 9:54 AM, Ryan Moore wrote: > Hi, I've read http://nakkaya.com/2009/12/07/zipping-xml-with-clojure/ and > http://stackoverflow.com/questions/1194044/clojure-xml-parsing/9595315#comment2

Re: Best IDE

2013-06-05 Thread Catonano
My 2 cents: it´s ture that the Emacs features are not discoverable and that the learning curve is mean. But it also true that once you´ve done it, it brings you a great value. My suggestions about Emacs: 1) Start with the footage by Peepcode. It´ll save you tons of time, especially if you´re no

Re: Making things go faster

2013-06-05 Thread Ben Mabey
On 6/4/13 10:16 PM, Kevin Downey wrote: midje makes each test a top level form, so test runs happen as a side effect of code loading, which means you cannot really run tests in a good way from the repl without doing some kind of ridiculous forced code reloading. I would definitely recommend sta

parsing xml with zip, xml and clojure.data.zip

2013-06-05 Thread Ryan Moore
Hi, I've read http://nakkaya.com/2009/12/07/zipping-xml-with-clojure/ and http://stackoverflow.com/questions/1194044/clojure-xml-parsing/9595315#comment24442712_9595315 , but the usage of (xml->) is still mysterious to me. If I have this for my xml file... (def myxml (zip-str "

Re: [ANN] alpacas: a new Clojure source viewer

2013-06-05 Thread Laurent PETIT
Hello, 2013/6/5 John Gabriele : > On Tuesday, June 4, 2013 4:24:49 PM UTC-4, Gary Trakhman wrote: >> >> Just fyi, most clojure libs are published under EPL or Apache licenses, of >> course the choice is up to you :-). GPL has some restrictions that would >> prevent the lib from being used in many

Re: [ANN] alpacas: a new Clojure source viewer

2013-06-05 Thread John Gabriele
On Tuesday, June 4, 2013 4:24:49 PM UTC-4, Gary Trakhman wrote: > > Just fyi, most clojure libs are published under EPL or Apache licenses, of > course the choice is up to you :-). GPL has some restrictions that would > prevent the lib from being used in many projects. > > from the EPL wikipedia

NullPointerException when creating protocol in macro

2013-06-05 Thread Vincent
I’m trying to write a macro that defines a protocol and a function that, when called, returns an implementation of that protocol. I’ve reduced the code to the following example: (defmacro create-protocol [protocol implementation] (let [[protocol-name signature] protocol] `(do (defpro

Re: Is it good functional style to use a protocol to create a plugin point?

2013-06-05 Thread Jim
I think this approach , no matter how decoupled it may be, HotSpot will have a hard time (if not impossible) inlining these fn-calls. The protocol approach you described will give you the best performance, especially if you type-hint your reify block. That said, for plugin type situations I prefe

Re: Is it good functional style to use a protocol to create a plugin point?

2013-06-05 Thread fmjrey
A map seems enough, unless there is a need for naming the set of functions, in which case the protocol could serve this purpose. But would that be the best way? I'm also curious to know what solutions the community has come up with about this. In the case of dynamic discovery of available plugin

Re: Making things go faster

2013-06-05 Thread Adam Rulli-Gibbs
What's wrong with midje's (autotest) in the REPL? I save code or test and the tests relevant to the namespace are automatically run. On Wednesday, 5 June 2013 05:16:39 UTC+1, red...@gmail.com wrote: > > midje makes each test a top level form, so test runs happen as a side > effect of code loadin

Re: My Clojure Workflow, Reloaded

2013-06-05 Thread Angel Java Lopez
It was recently discussed at https://groups.google.com/group/clojure/browse_thread/thread/f1a3bb6563fecf1c?hl=en See also http://blog.goodstuff.im/clojure_workflow Angel "Java" Lopez @ajlopez On Wed, Jun 5, 2013 at 8:21 AM, Julian wrote: > Stuart Sierra has written a fantastic article on hi

My Clojure Workflow, Reloaded

2013-06-05 Thread Julian
Stuart Sierra has written a fantastic article on his particular pattern for writing and testing Clojure code: http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded There is some commentary on Hacker News about it here: https://news.ycombinator.com/item?id=5819487 I'll include some

Re: Is it good functional style to use a protocol to create a plugin point?

2013-06-05 Thread john
yes that seems to me, that this better expresses that I'm plugging in a set of functions. thanks Am Mittwoch, 5. Juni 2013 12:55:16 UTC+2 schrieb Moritz Ulrich: > > If you want to keep this style, why not use a simple map of function > instead of reifying a protocol? Something like: > > (defn

Re: Is it good functional style to use a protocol to create a plugin point?

2013-06-05 Thread Moritz Ulrich
If you want to keep this style, why not use a simple map of function instead of reifying a protocol? Something like: (defn calc-multiply [data] ...) (defn calc-add [data] ...) (defn make-calc [] {:calc-add #'calc-add, :calc-multiply #'calc-multiply}) Looks simpler and cleaner for me. On Wed, Jun

Is it good functional style to use a protocol to create a plugin point?

2013-06-05 Thread john
Hi, I recently wrote some code for which I have 2 alternative implementations. So what I did is write a protocol: (defprotocol Calculator (calc-add [this data]) (calc-multiply [this data])) I then created two namespaces for my two implementations: which each had a function: (defn make-

Re: Making things go faster

2013-06-05 Thread Chas Emerick
Hi David, It's odd/interesting that you're finding yourself restarting the JVM regularly. For many years, I've developed Clojure with very rare restarts; especially if my baseline project configuration is stable, I often have REPL sessions that last days. (Random thought: it'd be cute if vari

Re: Making things go faster

2013-06-05 Thread Tassilo Horn
David Pollak writes: Hi David, > * Is there a faster cycle than to change code, change tests and type > "lein test" to see the results? Obviously, you can run the tests from the already running REPL. FWIW, when I change something in using Emacs/nrepl.el/clojure-mode in a namespace, I do C-c