Re: Looking to fit Clojure into my architecture and am in need of your informed advice!

2010-08-01 Thread Saul Hazledine
Hello Kent, On Aug 1, 2:00 pm, Kent Larsson wrote: > > I'm planning to reduce my time at my full time job to create a small > startup. And I am thinking about create a lean and mean architecture > which will enable me to get things done. > Cool! > I am thinking about creating a layered architect

Re: setting classpath and using namespace: how to enable example scripts in library?

2010-08-01 Thread Nikita Beloglazov
I don't know how my example fits your needs, but I use something like: # /bin/sh java -cp "lib/*":"src" clojure.main -e "(require 'my-project.core) (my-project.core/print-hello)" assuming, that in lib all neccesary libs are placed (clojure.jar, clojure-contrib.jar, etc) To download needed libs in

Re: Symbol substitution in macro

2010-08-01 Thread Heinz N. Gies
On Aug 2, 2010, at 3:34 , Kyle Schaffrick wrote: > Hello, > > I'm trying to write a library with two main parts. The first is a > macro, I'll call it 'with-feature, that walks through forms passed > inside it, and any time it sees a call to another function in my > library, 'feature, do some tra

Re: Bug: contains? doesn't work on transient maps or sets

2010-08-01 Thread Jason Wolfe
Related: in 1.2 RC1, "find" also fails to work with transient maps (although it does throw an error, rather than fail silently). On Aug 1, 12:25 pm, Mark Engelberg wrote: > I just tested this in Clojure 1.2, and the bug is still there: > > (contains? (transient #{1 2}) 1) -> false          ;sho

Symbol substitution in macro

2010-08-01 Thread Kyle Schaffrick
Hello, I'm trying to write a library with two main parts. The first is a macro, I'll call it 'with-feature, that walks through forms passed inside it, and any time it sees a call to another function in my library, 'feature, do some transformations. The problem I'm concerned about is as follows: W

Re: abstract structural binding

2010-08-01 Thread doug
thanks- you are correct. it is -what it is! -doug On Aug 1, 1:03 pm, Rasmus Svensson wrote: > 2010/8/1 doug <395curra...@gmail.com> > > > > > > > Hey all! > > > can't seem to get the last element to bind. tia -doug > > > user> cj-mpdata > > ["0010335602       " "" "40.00" "" "1060.51" "6/23/2010"

Re: dtd question

2010-08-01 Thread Randy Hudson
I think we're almost there, sorry for the various mistakes. If you look in the source for clojure.xml, you can see that the default "startparse" argument for xml/parse is (defn startparse-sax [s ch] (.. SAXParserFactory (newInstance) (newSAXParser) (parse s ch))) and we've only gotten as far a

setting classpath and using namespace: how to enable example scripts in library?

2010-08-01 Thread jandot
Hi all, I'm writing a library which is organized using "lein new", so the directory structure contains an "src" and "test". I have added a directory "examples" with scripts that should be able to run by just typing "./example-1.clj". So the directory structure is: +- project.clj +- src |

Re: Bug: contains? doesn't work on transient maps or sets

2010-08-01 Thread Mark Engelberg
I just tested this in Clojure 1.2, and the bug is still there: (contains? (transient #{1 2}) 1) -> false ;should return true On Mon, Mar 22, 2010 at 5:46 PM, Mark Engelberg wrote: > Disturbingly, it doesn't error, it just always returns false. > This is in version 1.1. Can someone chec

Re: Clojure 1.2 RC1

2010-08-01 Thread Mark Engelberg
Aha, so it is. Thanks! -- 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. To unsubscribe from this gr

Re: Clojure 1.2 RC1

2010-08-01 Thread Btsai
The jar can be located in the target sub-directory. On Aug 1, 2:37 am, Mark Engelberg wrote: > Meant to say, "...zip doesn't have a compiled jar..." > > On Sun, Aug 1, 2010 at 1:36 AM, Mark Engelberg > wrote: > > > > > On Fri, Jul 30, 2010 at 8:00 AM, Stuart Halloway < > > stuart.hallo...@gmail.

Re: dtd question

2010-08-01 Thread Manfred Lotz
Hi Randy, On Sun, 1 Aug 2010 10:04:16 -0700 (PDT) Randy Hudson wrote: > Right you are Michael; sorry for the missing paren at the end of the > def. > Now compiling the code works: (def parser (.newSAXParser (SAXParserFactory/newInstance))) (.setEntityResolver (.getXMLReader parser) resolver

Re: dtd question

2010-08-01 Thread Randy Hudson
Right you are Michael; sorry for the missing paren at the end of the def. On Aug 1, 11:59 am, Michael Wood wrote: > On 1 August 2010 17:15, Manfred Lotz wrote: > > > > > > > Hi Randy, > > > On Sun, 1 Aug 2010 06:23:58 -0700 (PDT) > > Randy Hudson wrote: > > >> Hi Manfred, > > >> I'm sorry the c

Re: abstract structural binding

2010-08-01 Thread Rasmus Svensson
2010/8/1 doug <395curra...@gmail.com> > Hey all! > > can't seem to get the last element to bind. tia -doug > > user> cj-mpdata > ["0010335602 " "" "40.00" "" "1060.51" "6/23/2010" "DISCOVER E- > PAYMENT 7796" "" "" ("DISCOVER")] > user> (let [[[_ ck db cr _ dt _ _ _][dsc]] > [["Acc

Re: dtd question

2010-08-01 Thread Michael Wood
On 1 August 2010 17:15, Manfred Lotz wrote: > Hi Randy, > > On Sun, 1 Aug 2010 06:23:58 -0700 (PDT) > Randy Hudson wrote: > >> Hi Manfred, >> >> I'm sorry the code wasn't quite correct. The EntityResolver is set on >> the parser's XMLReader, not on the parser itself: >> >> (def parser (.newSAXPar

Looking to fit Clojure into my architecture and am in need of your informed advice!

2010-08-01 Thread Kent Larsson
Hi! I'm not any good at Clojure, but it seems like a great language! I have tried some examples and am reading a book about it. I have dabbled with Haskell before and I am really fascinated by the functional paradigm. I'm planning to reduce my time at my full time job to create a small startup. A

Implementing let-over-lambda chapter 7 badger network for sorting

2010-08-01 Thread Christian Schuhegger
Hello, I am currently trying to implement part of chapter 7 in let-over- lambda in Clojure. I am used to writing ANSI Common Lisp code and relatively new to Clojure. In CL it is possible to get a performance gain over the standard lisp sort function by using compiled sort networks. I am trying to

abstract structural binding

2010-08-01 Thread doug
Hey all! can't seem to get the last element to bind. tia -doug user> cj-mpdata ["0010335602 " "" "40.00" "" "1060.51" "6/23/2010" "DISCOVER E- PAYMENT 7796" "" "" ("DISCOVER")] user> (let [[[_ ck db cr _ dt _ _ _][dsc]] [["Acct" "Chk" "Debt" "Crd" "Bal" "Date" "Desc" "Payee" "Cat

Re: Today is "Get Your App on Clojure 1.2" Day

2010-08-01 Thread lozh
These should be fixed in technomancy's github. He pushed http://github.com/downloads/technomancy/leiningen/leiningen-1.3.0-SNAPSHOT-standalone.jar yesterday, which I'd expect to include the fixes, though I haven't tested it myself. On Jul 30, 11:33 pm, Bootvis wrote: > There seems to be a problem

Re: Today is "Get Your App on Clojure 1.2" Day

2010-08-01 Thread Dmitry Gutov
That's leiningen bug 62: http://github.com/technomancy/leiningen/issues/closed/#issue/62 It should be fixed in trunk. On Jul 31, 2:33 am, Bootvis wrote: > There seems to be a problem with the RC on Windows. I was > followinghttp://mmcgrana.github.com/2010/07/develop-deploy-clojure-web-applica..

Re: How to do multiple trys

2010-08-01 Thread abhinav sarkar
Thanks to everyone for their suggestions. This is what I have used finally: (defn parse-date [date-str] (when-not (blank? date-str) (let [clean-date-str (trim date-str) parse-or-nil (fn [format] (try (.parse format clean-date-str)

Re: dtd question

2010-08-01 Thread Manfred Lotz
Hi Randy, On Sun, 1 Aug 2010 06:23:58 -0700 (PDT) Randy Hudson wrote: > Hi Manfred, > > I'm sorry the code wasn't quite correct. The EntityResolver is set on > the parser's XMLReader, not on the parser itself: > > (def parser (.newSAXParser (SAXParserFactory/newInstance)) > (.setEntityResolver

Re: Today is "Get Your App on Clojure 1.2" Day

2010-08-01 Thread Phil Hagelberg
On Fri, Jul 30, 2010 at 3:33 PM, Bootvis wrote: > There seems to be a problem with the RC on Windows. I was following > http://mmcgrana.github.com/2010/07/develop-deploy-clojure-web-applications.html > using the RC and doing "lein.bat run script/run.clj" errors with: > > Exception in thread "main"

Re: dtd question

2010-08-01 Thread Randy Hudson
Hi Manfred, I'm sorry the code wasn't quite correct. The EntityResolver is set on the parser's XMLReader, not on the parser itself: (def parser (.newSAXParser (SAXParserFactory/newInstance)) (.setEntityResolver (.getXMLReader parser) resolver) You don't need any external jars: all the classes an

Re: dtd question

2010-08-01 Thread Manfred Lotz
Hi Randy, Thanks for your help. A bit late my answer because in the meantime I was on vacation and only now found the time to pursue it further. On Tue, 29 Jun 2010 18:53:30 -0700 (PDT) RandyHudson wrote: > Yes, you can do this by defining an EntityResolver that corrects the > bad system id, de

Re: Clojure 1.2 RC1

2010-08-01 Thread Mark Engelberg
Meant to say, "...zip doesn't have a compiled jar..." On Sun, Aug 1, 2010 at 1:36 AM, Mark Engelberg wrote: > On Fri, Jul 30, 2010 at 8:00 AM, Stuart Halloway < > stuart.hallo...@gmail.com> wrote: > >> Clojure 1.2 RC 1 is now available, along with a corresponding Clojure >> Contrib, at: >> >> htt

Re: Clojure 1.2 RC1

2010-08-01 Thread Mark Engelberg
On Fri, Jul 30, 2010 at 8:00 AM, Stuart Halloway wrote: > Clojure 1.2 RC 1 is now available, along with a corresponding Clojure > Contrib, at: > > http://clojure.org/downloads > > Is there any particular reason the contrib release candidate zip have a compiled jar inside it? -- You received this

Re: Today is "Get Your App on Clojure 1.2" Day

2010-08-01 Thread Mark Engelberg
On Fri, Jul 30, 2010 at 8:52 AM, Stuart Halloway wrote: > > Also, while > microbenchmarks are often misleading, if you have some that seem to show 1.2 > issues I would be happy to run them and take a look. > > Stu > > Yeah, I'm not talking