Re: Migrating nREPL out of Clojure Contrib

2017-07-18 Thread Colin Jones
FWIW, as someone who's used and made small contributions to nREPL, I'm fine with any of the options (leaving it in contrib, forking, rebooting). My lack of contributions hasn't been due to process around nREPL (my lack of activity on REPLy [1] can validate that) - more around a lack of direct p

Re: If a Java function seems to never return, how do I test?

2015-11-04 Thread Colin Jones
Any chance the thing being thrown was not an Exception, but still a Throwable? e.g. AssertionError would behave in the way you've described here, unless I'm missing some detail - https://docs.oracle.com/javase/7/docs/api/java/lang/AssertionError.html -- You received this message because you ar

Re: Why does the following Clojure code take 10x the time the C# version does? How to improve the Clojure version?

2015-05-14 Thread Colin Jones
I can heartily recommend Java Performance: The Definitive Guide to anyone interested in digging further into all the knobs you can set on the command line: http://www.amazon.com/Java-Performance-The-Definitive-Guide/dp/1449358454 -- You received this message because you are subscribed to the Go

Re: Removing the 5th, 10th, 15th ... element of a list

2015-02-17 Thread Colin Jones
Sounds almost like a mirror image of `clojure.core/take-nth`, so something like this is kind of fun: (defn drop-nth [n coll] (lazy-seq (when-let [s (seq coll)] (concat (take (dec n) s) (drop-nth n (drop n s)) On Tuesday, February 17, 2015 at 1:21:20 PM UTC-6, Cecil Westerhof

Re: How can I remove the nils in the result?

2014-12-23 Thread Colin Jones
Thanks, I had fun with this! This isn't more concise, but I went in a little a different direction, trying to pull the various concerns apart. In particular I had fun separating: - the idea of intervals for which any predicate passed from the specific case of 0/1 equality comparison - the strin

Re: Defs with %

2014-06-17 Thread Colin Jones
Yeah the latter version parses as 2 symbols in sjacket, whereas the defn version parses as a single list. user=> (p/parser "top%") #net.cgrand.parsley.Node{:tag :net.cgrand.sjacket.parser/root, :content [#net.cgrand.parsley.Node{:tag :symbol, :content [#net.cgrand.parsley.Node{:tag :name, :con

Re: Leiningen Clojure REPL in Windows doesn't accept arrow keys.

2014-05-04 Thread Colin Jones
It's due to jline not handling virtual key codes on Windows (which fails in some [all?] non-US locales). This has been fixed on jline master by https://github.com/jline/jline2/pull/134, but there's no jline release available yet. It'll be in the next REPLy release, even if I need to depend on a

Re: Comprehensive lein template list?

2014-04-25 Thread Colin Jones
Since these projects have to be named lein-template, you can actually get the full list via `lein search`, provided you don't need to search non-standard/private repositories. I bumped my :user profile's :search-page-size to 1000, and got this when I ran `lein search lein-template`: https://gis

Re: core.async/thread failing silently

2013-12-08 Thread Colin Jones
I've run this a bunch of times (in BOTH `lein repl` and `java -cp [...] clojure.main`), and have observed both this code printing the OOM exception, and it being silent as you observed. The difference in trials *seems* to be that if I skip the intermediate steps, going straight for the big one

Re: Java Metadata Wrapper

2013-09-01 Thread Colin Jones
I thought of protocols initially here too, but protocols just define functions, so where would the data live that you want as metadata? A closure over the data? This implies extending the protocol on a per-instance basis, which afaik doesn't exist (cljs design work aside http://dev.clojure.org

Re: First day with Macros

2013-06-18 Thread Colin Jones
ther idea to look at, besides the great ones Gary mentioned, is a blog I did awhile back quoting: http://blog.8thlight.com/colin-jones/2012/05/22/quoting-without-confusion.html - Colin On Tuesday, June 18, 2013 2:47:58 AM UTC-5, Hussein B. wrote: > > I don't get why we have to use a se

Re: Multiple args: opts map vs inline arguments

2013-06-18 Thread Colin Jones
+1 James. I can't count the number of times I've found myself unrolling an options map with a dance like this apply / apply concat. And don't forget that the function itself then has to roll this options map back up to operate on it, which syntactically isn't all that bad, but it usually seem

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

2013-06-10 Thread Colin Jones
On Monday, June 10, 2013 9:20:31 AM UTC-5, tbc++ wrote: > > >> 1) testing recursive functions. I want to test what a recursion STEP > does, not the >> whole function. Can I mock 'recur'? > > You shouldn't need to, pull the body of the loop out as as separate > function, then test that function.

Re: is there a way to use clojure.main/repl from lein?

2013-05-27 Thread Colin Jones
On Monday, May 27, 2013 12:48:24 PM UTC-5, stuart@gmail.com wrote: > > I thought I wanted some of the affordances, but not the nrepl connection > (e.g. get to reply's standalone eval mode). > > But it turns out that for my use case, I don't need any of that, so > calling clojure.main directly

Re: FileNotFoundException when running lein droid new

2013-03-25 Thread Colin Jones
On Monday, March 25, 2013 4:02:40 PM UTC-5, Scott Thoman wrote: > > All, > > I figured I'd give the leiningen droid plugin a shot now that I've got a > few spare moments to mess around with clojure for an android app. However, > when I attempt to bootstrap a new project, I get the following: > -

Re: Including the same require/refers in every namespace

2013-03-25 Thread Colin Jones
On Monday, March 25, 2013 2:26:11 PM UTC-5, Clinton Dreisbach wrote: > This may be a ridiculous idea/question, but: > > I have an application with many namespaces and every single one of > them has the same require/refer statement in the ns to add logging and > string manipulation. Is there a w

Re: What is the difference between *source-path* and *file*?

2013-02-19 Thread Colin Jones
Yeah, there's been a patch in JIRA for that since 2010, and an updated one since October 2012: http://dev.clojure.org/jira/browse/CLJ-196 On Tuesday, February 19, 2013 1:08:22 PM UTC-6, Brian Marick wrote: > > By the way, the doc string for `*file*` is wrong: > > > clojure.core/*file* > > The

Re: [ANN] nrepl-transcript

2013-01-14 Thread Colin Jones
Great idea - and with so little code! On Monday, January 14, 2013 2:58:55 PM UTC-6, Jonas wrote: > > Hi > > I created a middleware for nrepl that saves a transcript of your repl > interactions so you can go back and see what you did. > > https://github.com/jonase/nrepl-transcript > > Feedback w

Re: class loaders stack constant grow in REPL

2012-12-10 Thread Colin Jones
Right, this is because nREPL uses clojure.main/repl each time it does an evaluation. See http://dev.clojure.org/jira/browse/NREPL-31 for a related issue that was addressed by modifying clojure.main/repl. I'm not sure where a fix for this would belong (nREPL or clojure.main), but I went ahead an

Re: Odd residual exception behaviour at the repl

2012-08-25 Thread Colin Jones
It's a bug in reply. I've opened up an issue to get it fixed - thanks for the report. https://github.com/trptcolin/reply/issues/80 On Saturday, August 25, 2012 3:06:28 PM UTC-5, John Gabriele wrote: > > Ran into something odd. Not sure if it's a bug. > > In the repl, if I try `(def x ^{:a 1}

Re: Reader errors with Datomic free

2012-07-26 Thread Colin Jones
In Leiningen, the reader side is in a different process (owned by Leiningen, without your project code on the classpath), than the execution side. So I think you see this error due to classpath separation: the lein side doesn't have data_readers.clj specification, or the reader functions define

Re: slurp on over slow HTTP crashes clojure?

2012-07-19 Thread Colin Jones
Is this using REPLy / a lein2-previewX repl, by chance? I fixed a memory leak in REPLy yesterday that happened in long-running command scenarios, and could have caused this behavior (see https://github.com/technomancy/leiningen/issues/691 for details). - Colin On Wednesday, July 18, 2012 10

Re: Buggy FP behavior with Clojure 1.3

2012-06-26 Thread Colin Jones
To address the Infinity exception that Sean & AJ are seeing, I think the issue there is that in REPLy / lein repl, we do a `read` of the input, and then `pr-str` the result and send it on to nREPL. So when nREPL goes to re-read the value back in, that's what triggers the compiler error. user=>

Re: Boolean

2012-04-08 Thread Colin Jones
zation, you sidestep the issue. Granted, that'd require some additional code, but it could still be reasonably nice w/ polymorphism via protocols or multimethods. You could also avoid it by using Carbonite (which uses Kryo) instead of working with plain old ObjectInputStreams: https://github.

Re: GSOC Idea: Interactive documentation with autodoc

2012-03-26 Thread Colin Jones
o 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, vis

Re: Leiningen 2.0.0-preview1

2012-03-09 Thread Colin Jones
Yes, it's not supported yet in lein2 because REPL-y doesn't support it yet. But it's definitely on my plate to knock out soon, along with :prompt support, although :repl-* options will likely be collapsed into a :repl-options map. https://github.com/technomancy/leiningen/issues/432 https://gith

Re: Idiomatic record construction in 1.3

2011-10-25 Thread Colin Jones
+1 A further argument in favor of your choices is that p3 and m2 both work great with higher-order fns, which I didn't immediately find a way to do with any of the others: user=> (map (partial apply ->Person) [["bob" "loblaw"] ["stan" "sitwell"]]) (#user.Person{:first "bob", :last "loblaw"} #us

Re: clojure.contrib.profile crashes

2011-07-25 Thread Colin Jones
This could be the same issue that Kevin Baribeau has found with clojure.contrib.profile here: https://github.com/richhickey/clojure-contrib/pull/2#issuecomment-1385392 (Yes, we know he needs a CA, etc. - he mentions requesting assembla access before closing that pull request.) TL;DR - might w