feedback on file parsing with Clojure

2017-06-16 Thread AndyK
hello, i'm looking for some feedback on how i've used Clojure to do some file parsing still getting the hang of Clojure ways of thinking and i'd love to hear any advice on how to improve what i've done for example, i'm guessing the way i've used cond blocks is a bit sketchy - at that point, i w

Which emacs packages?

2012-03-08 Thread AndyK
Curious about which emacs packages folks use for increased Clojure productivity (beyond the obvious, like slime/swank-clojure)... -- 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

Dynamic test creation?

2011-10-28 Thread AndyK
I am setting up tests with clojure.test that are driven by a CSV where each line represents one test case. Right now, there is a single deftest function that runs all the assertions. That's ok but creates reporting like 1 test was run with 1000s of assertions. Clojure being so dynamic, is it possib

Lazytest on the repl?

2011-10-28 Thread AndyK
How can lazytest describe blocks be run from the repl? -- 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 po

Re: Dynamic test creation?

2011-11-01 Thread AndyK
run-tests like a file full of deftests)? On Oct 31, 9:56 am, Nate Young wrote: > On 10/28/2011 09:42 AM, AndyK wrote:> I am setting up tests with clojure.test > that are driven by a CSV where > > each line represents one test case. Right now, there is a single > > def

Await and thread blocking?

2011-11-01 Thread AndyK
I would like to block the thread until an agent has done its thing - in this case serving as a cap on a timer. I had thought that wrapping a call to the timed-agent function with await would do just that, but apparently not. At least in the repl, the function returns immediately and you can follow

Re: Await and thread blocking?

2011-11-01 Thread AndyK
ideas for using Timer while blocking the current thread? Is a future a better choice here? On Nov 1, 4:19 pm, AndyK wrote: > I would like to block the thread until an agent has done its thing - > in this case serving as a cap on a timer. I had thought that wrapping > a call to the timed-

Re: Await and thread blocking?

2011-11-01 Thread AndyK
not depend on the value of the agent - the agent is just a convenient way to limit the timer. On Nov 1, 4:29 pm, AndyK wrote: > After a bit more digging - Timer is a background thread so clearly > that's not going to mesh well as a foreground blocking activity with > agent (which

Problem passing a function into a function

2011-11-03 Thread AndyK
I'm running into a strange problem that I can't see the bottom of. Wonder if someone can explain why I'm seeing the behavior I'm seeing... I have a function that uses a Java timer to run a function and can also check the results of that function by passing in an optional test function (defn timed

Introspecting functions

2011-11-03 Thread AndyK
Is it possible to print information about a function from within the repl? For example, after using comp or partial to create new functions, can you display the arity, the source, etc? I'm trying to debug a problem and it would be handy to be able to check that my dynamic funcitons are what I think

Korma - cannot acquire connections

2011-11-04 Thread AndyK
I believe I have setup korma correctly with (require '[korma.db :as db]) (require '[korma.core :as sql]) (db/defdb devdb (db/mysql {:db "mydb" :host "localhost" :user "me" :password "mypass"})) (sql/defentity mytable (sql/select mytable (sql/fields :id) (sql/where {:id 1}))) But I'm getting SQLExc

Update swank classpath on the fly?

2011-11-04 Thread AndyK
I've noticed that swank (which I run in emacs using M-x clojure-jack- in) doesn't pickup changes to the classpath on-the-fly. For example, if I update my leiningen project.clj with a new dependency and run lein deps, I need to restart swank to have it use the library. Is there a way to load somethi

Re: Korma - cannot acquire connections

2011-11-06 Thread AndyK
(sql/ > where {:id 1}))) > > I does this work? > > (sql/defentity mytable >   (:pk <<< YOUR PRIMARY KEY AS A KEYWORD>>>) >   (table <<>>) >  (database devdb)) > > (sql/select mytable (sql/fields :id) (sql/where {:id 1})) > > On Nov 4

lein test with command-line args?

2011-11-07 Thread AndyK
Is it possible to pass command-line arguments to tests using leiningen? Looking for ways to control the way that tests are run using lein test by passing in switches (e.g. which environment it runs against, which tests run, etc). One workaround that occurs to me is to use lein run where run calls r

Re: lein test with command-line args?

2011-11-08 Thread AndyK
Nov 7, 5:17 pm, Phil Hagelberg wrote: > On Mon, Nov 7, 2011 at 2:14 PM, AndyK wrote: > > Is it possible to pass command-line arguments to tests using > > leiningen? Looking for ways to control the way that tests are run > > usingleintestby passing in switches (e.g. which envir

Re: Dynamic test creation?

2011-11-08 Thread AndyK
; :: " scenario the file did compile. Is the fact that deftest is also a macro going to cause a problem with the original idea? On Nov 2, 8:36 am, Nate Young wrote: > On 11/01/2011 03:05 PM, AndyK wrote: > > > How would (run-tests 'my-namespace) know to run all thosedynami

Re: Dynamic test creation?

2011-11-09 Thread AndyK
e a tabular fact.  Tje tabular fact will give you good > reporting. > On Nov 8, 2011 1:44 PM, "AndyK" wrote: > > > > > > > > > I finally had a chance to try this out and it fails with > > > error: java.lang.ClassCastException: java.lang.String

Proper parallelism?

2011-11-22 Thread AndyK
I have been using Clojure to write tests on RESTful applications. Since the requests are independent, parallelizing would speed things along. What is the best approach? Using pmap is the obvious first step. Afaik, pmap only creates a small pool of threads. Is there more to gain by going to the Java

Re: Avout: Distributed State in Clojure

2011-11-30 Thread AndyK
If you're willing to dig into another language, 'Erlang and OTP in Action' gives a great overview of Erlang and the distributed principles underlying that language. Though different from the approach of distributed STM, the concepts of distributed applications are baked into the core of Erlang. On

The Clojure way to solve this problem?

2011-11-30 Thread AndyK
I have Clojure code which makes HTTP requests to a server. Depending on the context, I want to swap out the underlying HTTP library code. For example, I use an instrumented library in a testing context and a different library in a REPL context where the instrumented library will not work. These are

Re: The Clojure way to solve this problem?

2011-12-03 Thread AndyK
lag and fork > in the code O_o > > > > > > > > On Wed, Nov 30, 2011 at 5:53 PM,AndyK wrote: > > I have Clojure code which makes HTTP requests to a server. Depending > > on the context, I want to swap out the underlying HTTP library code. > > For example,

swank-cdt problems

2011-12-05 Thread AndyK
I'd like to be using swank-cdt, but I'm running into the tools.jar problem warning: unabled to add tools.jar to classpath. CDT 1.4.0a startup failed: # In project.clj, I've tried :extra-classpath-dirs ["/usr/lib/jvm/java-6-sun/lib/tools.jar"] and :dev-resources-path "/usr/lib/jvm/java-6-openjdk

Re: swank-cdt problems

2011-12-05 Thread AndyK
ck-in Thoughts? On Dec 5, 1:32 pm, AndyK wrote: > I'd like to be using swank-cdt, but I'm running into the tools.jar > problem > > warning: unabled to add tools.jar to classpath. > CDT  1.4.0a startup failed:  # java.lang.RuntimeException: java.io.IOException: Not a debu

Re: swank-cdt problems

2011-12-08 Thread AndyK
the > problem.  I'll look into it, but in the meantime, can you also try > using "lein swank" and then "M-x slime-connect". > > On Dec 5, 10:32 am,AndyK wrote: > > > > > > > > > I'd like to be using swank-cdt, but I&#x

Re: ANN: Clojure 1.4.0-beta1

2012-02-03 Thread AndyK
On Feb 3, 10:47 am, Stuart Sierra wrote: > Clojure 1.4 goes beta! This release is essentially the same as > 1.4.0-alpha5. It will hit the Maven Central repository in a few hours. > > No new features in the 1.4 line after this point. Bug fixes are still allowed. > > Also, if somebody wants to compi