Re: Using java.ext.dirs to manage the Classpath for Clojure REPLs

2009-01-04 Thread Drew Raines
Stephen C. Gilardi wrote: > The "java.ext.dirs" System property provides a very convenient way to > set up and maintain a Classpath for Clojure REPLs. [...] > In my case, I set the value of java.ext.dirs to a list of just one > directory. That directory contains (relative) symbolic links to all

Re: .newInstance error

2009-01-05 Thread Drew Raines
Justin Johnson wrote: > Will someone please explain to me why this isn't working? Is there > something special about newInstance that I'm missing? > > user=> (. org.tmatesoft.svn.core.wc.SVNClientManager newInstance) > # >From the Javadoc, newInstance is a static method on SVNClientManager, so

Re: Slime buffer ns is always user

2009-01-09 Thread Drew Raines
Bill Clementson wrote: > It appears to work ok for me with the following namespace declarations: > (in-ns 'test) > (ns test) > (ns test (:use clojure.xml)) This no longer works for me because of the newline: (ns foo.bar (:require [clojure.contrib.sql :as sql])) I simplified the regexp a

JVM hanging after -main

2009-04-16 Thread Drew Raines
I have a command line utility that calls (exit 0) at the end of (-main). It looks like this: (defn exit [status] (shutdown-agents) (flush) (System/exit status)) Yet, despite this, the JVM never exits. Here is a snippet of jstack output: --8<---cut here---s

Re: JVM hanging after -main

2009-04-16 Thread Drew Raines
Chas Emerick wrote: > I believe this is an issue related to how the threadpools used by > executors are populated by default, i.e. they use non-daemon > threads. > > clojure.lang.Agent uses instances of these default threadpool > configurations, which is likely the cause of the delayed shutdown >

Re: How to have one lib with source in multiple files

2009-04-23 Thread Drew Raines
billh04 wrote: > Right now I have the two files "whale.achi.model.place.clj" and > "whale.achi.model.placeEvaluation.clj" that make up one name space > "whale.achi.model.place". > The first file is the "root" of the namespace. I think you're confused with how Clojure looks for packages in the fi

Re: Got a Clojure library?

2009-05-01 Thread Drew Raines
ude 3rd party dependencies if any. Name: Postal URL: http://github.com/drewr/postal/tree/master Author: Drew Raines Category: Mail, protocols, networking License: MIT Description: Postal is a library for constructing and sending RFC822-compliant Internet email messages. It wraps th

Supply existing session for Postal message (was: Got a Clojure library?)

2009-05-03 Thread Drew Raines
Mark Derricutt wrote: > Is there support in this lib currently for reusing an existing > MailSession (or passing in say "java://comp/env/mail/Session" and > having it handle the lookup? > > Shouldn't be hard to add in if its not already there? I've added the ability to supply an existing Session

Re: constructing maps

2009-05-04 Thread Drew Raines
Nathan Hawkins wrote: > Possibly I'm going about this wrong. I'm trying to understand how > best to construct maps from sequences, by applying a function which > returns a key / value pair. [...] > Am I overlooking some already existing function hidden away someplace > that does this? Here's

Re: constructing maps

2009-05-04 Thread Drew Raines
On May 4, 8:05 am, Drew Raines wrote: > user> (let [test-str "foo=1;bar=2;baz=3"] >         (reduce conj {} >            (map #(apply hash-map (seq (.split % "="))) >                (.split test-str ";" Whoops, that (seq) is a debugging artifac

Re: JVM hanging after -main

2009-05-27 Thread Drew Raines
billh04 wrote: > I think you are responsible for ending the currently running > agents. The usual method is to set up some field which the agents > monitor looking for some value indicating the application is > ending. By "ending currently running agents" do you mean the action run on the agent

Re: turn a seq into a list

2009-07-16 Thread Drew Raines
jvt wrote: > Doesn't apply have a limit on the length of the arguments passed, > too? Yes. http://groups.google.com/group/clojure/msg/34b9a170d36c5ab5 -Drew --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojur

Re: google custom search engine

2009-12-14 Thread Drew Raines
Gene Tani wrote: > http://www.google.com/cse/home?cx=013940287744875509343:60ybe0lrjm4 This one has been around for almost a year. I'm happy to add anyone who'd like to help maintain it. http://www.google.com/cse/home?cx=004621955734675372103:0oxuogeollc -Drew -- You received this message be

Re: Small line-seq regression?

2009-12-14 Thread Drew Raines
Rich Hickey wrote: > On Mon, Dec 14, 2009 at 8:48 AM, Chouser wrote: [...] >> Your analysis and solution seem right to me.  Rich, would you >> accept a ticket for this? >> > > Yes, and could someone please check the other functions that were > patched similarly? I'll do it since I created the

Re: Milters?

2010-03-01 Thread Drew Raines
Depends on how you invoked it. Execution time would kill you if it was a standalone program, but I could envision a persistent process listening on a unix socket that was queried by a Perl or C program. The Clojure program would do the heavy lifting of examining messages in parallel, returning sta

Re: Splitting a string with the characters between each split?

2010-05-13 Thread Drew Raines
You could do it by using the word boundary regexp operator. (ns foo.bar (:use [clojure.contrib.string :only [split]])) (defn split* [s] (drop 1 (split #"\b" s))) (split* "ab c de") ;; ("ab" " " "c" " " "de") -Drew On Thu, May 13, 2010 at 11:24, joshua-choi wrote: > I'd like to know i

Re: Hooking up Postal to Amazon SES

2012-06-04 Thread Drew Raines
rossputin wrote: > Has anyone hooked Postal up to SES ? I tried it this morning and it works fine. I added a section to the readme about it: https://github.com/drewr/postal/commit/da8d89a54fad4f8c4e8c617d49c57dc8d8b44473 Open an issue if you find a problem. Thanks! -Drew -- You received th

Re: Question about lein swank and emacs

2010-10-25 Thread Drew Raines
Mark Engelberg wrote: > When you start a swank server with lein swank, and then connect to > it via slime-connect in emacs, is there any way from within emacs > to restart the swank server and/or delete all definitions to start > from a clean slate? In the *slime-repl ...* buffer enter: , rest

Re: Question about lein swank and emacs

2010-10-26 Thread Drew Raines
David Jagoe wrote: > On 26 October 2010 04:36, Mark Engelberg wrote: >> When I do restart-inferior-lisp, it says, "no inferior lisp process". > > Yeah, that'll only work if you originally started swank from emacs > as the inferior lisp process. If you're doing 'lein swank' on the > command line i

Re: Question about lein swank and emacs

2010-10-26 Thread Drew Raines
t 26, 2010 at 11:53, Drew Raines wrote: > David Jagoe wrote: > >> On 26 October 2010 04:36, Mark Engelberg wrote: >>> When I do restart-inferior-lisp, it says, "no inferior lisp process". >> >> Yeah, that'll only work if you originally started swank f

Re: Question about lein swank and emacs

2010-10-26 Thread Drew Raines
Mark Engelberg wrote: > I'm confused. Is there a better way to get a REPL going in Emacs > other than "lein swank" from a command line combined with M-x > slime-connect in Emacs? It's subjective. I like M-x lein-swank because it retains control of the swank process as an inferior-lisp, which le

Re: Question about lein swank and emacs

2010-10-26 Thread Drew Raines
Mark Engelberg wrote: > So what steps do you need to go through so that M-x lein-swank > works? (When I type that, nothing happens). Oh. I forgot that's not part of lein proper. Phil posted some code earlier this year that binds a process started by `lein swank` to a *lein-swank* buffer.

PATCH: Make name accept String

2008-11-11 Thread Drew Raines
I may be missing some philosophical significance of the name function, but is there any reason why it can't work on Strings as well as Named-s? user=> (name :foo) "foo" user=> (name "foo") "foo" This would clean up conditionals I have scattered about where I normalize heterogeneous collections of

Re: agents: producer consumer example

2008-11-13 Thread Drew Raines
Parth Malwankar wrote: > So for example is it possible to do something like this at > the end of file: > > (when (running-as-script) > (doseq x (repeatedly #(Thread/sleep 100 I do it with this idiom: (when *command-line-args* ...) Check out Script.java for more info. -Drew --~-