labrepl and port 8080

2010-08-12 Thread Manfred Lotz
Hi, In my case port 8080 is in use on my laptop because another application runs on 8080. Wouldn't it be a good idea to make the port 8080 the default and provide an option to start script/repl with another port. Then: script/repl -h could tell about the possibility to specify your own p

Re: dtd question

2010-08-03 Thread Manfred Lotz
Hi Randy, On Sun, 1 Aug 2010 15:02:59 -0700 (PDT) Randy Hudson wrote: > 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] > (.. SAXPa

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

dtd question

2010-06-29 Thread Manfred Lotz
Hi there, I got a directory tree of xml documents all having the same dtd. However the dtd file is not where the DOCTYPE SYSTEM entry says it is. Currently, xml/parse throws an exception that the dtd file will not be found. Is there a possibility to tell xml/parse about a different location of th

Re: Leiningen documentation review?

2010-06-17 Thread Manfred Lotz
Hi Phil, On Wed, 16 Jun 2010 21:24:55 -0700 Phil Hagelberg wrote: > I'm pushing for a Leiningen 1.2.0 release really soon now, and part of > that effort is sprucing up the documentation. I've revamped the readme > and added a tutorial for folks just getting started. Of course, > self-editing is

Re: nailgun: simple example problem

2010-04-10 Thread Manfred Lotz
On Sat, 10 Apr 2010 15:10:58 -0700 Brendan Ribera wrote: > Try this instead: > ... > > > >:main *nailgun.*example) > > Thanks a lot. Yes :main nailgun.example) does work fine. -- Manfred -- You received this message because you are subscribed to the Google Groups "Clojure" gr

Re: nailgun: simple example problem

2010-04-10 Thread Manfred Lotz
Hi Phil, On Sat, 10 Apr 2010 09:54:29 -0700 Phil Hagelberg wrote: > On Sat, Apr 10, 2010 at 3:27 AM, Manfred Lotz > wrote: > > <snip--> > > (defproject example "0.1" > >    :desc

nailgun: simple example problem

2010-04-10 Thread Manfred Lotz
Hi there, As a clojure newbie I tried to run a nailgun example from Phil Hagelburg which I found here in the archive. I created a directory example. In example I put a file project.clj (defproject example "0.1" :desc

Re: fn? question

2010-04-04 Thread Manfred Lotz
Hi Per, On Sun, 4 Apr 2010 15:28:23 +0700 Per Vognsen wrote: > (map #(fn? (when-let [x (resolve (symbol %))] @x)) ["map", "first", > "nofun"]) should do the trick. But before you go ahead and do this, > make sure it's what you actually need. > > -Per > Thanks a lot. That was exactly what I w

fn? question

2010-04-04 Thread Manfred Lotz
Hi there, I can ask if something is an fn, like this: (fn? first) How do I do it when first is a string? Example: (def mylist '( "map", "first", "nofun")) This doesn't work, of course: (map fn? mylist) How can I transpose, e.g. "first" to something so that I can feed fn? with it? --

Re: Default value for structure

2010-03-07 Thread Manfred Lotz
On Sun, 7 Mar 2010 12:35:27 +0800 Mike Mazur wrote: > Hi, > > On Sat, Mar 6, 2010 at 20:36, Manfred Lotz > wrote: > > Now I tried a different way: > > > > (defstruct st :a :b) > > > > (defn my-struct-map [s & inits] > >  (let [sm (struct-map

Re: Default value for structure

2010-03-06 Thread Manfred Lotz
On Mon, 1 Mar 2010 11:01:36 -0800 (PST) ataggart wrote: > No, but if you need to do that, then you can do what deftype sort-of > does: > > user=> (defstruct St :a :b) > #'user/St > user=> (defn st ([a] (struct St a 0.0)) ([a b] (struct St a b))) > #'user/st > user=> (st 5) > {:a 5, :b 0.0} > >

Default value for structure

2010-03-01 Thread Manfred Lotz
Hi, Can I have a default value for a member of a structure which is not specified when doing a struct-map? Minimal example: I have (defstruct st :a :b) and always when I define something like this (struct-map st :a 4) omitting :b I would like to have :b set automatically to 0.0 instead having nil.

Re: newbie question about ns and :require

2010-01-25 Thread Manfred Lotz
On Sun, 24 Jan 2010 12:33:11 -0800 (PST) ".Bill Smith" wrote: > Manfred, > > The (:require clojure.contrib.classpath) tuple tells the ns function > to load the clojure.contrib.classpath library if it has not already > been loaded. Clojure looks for clojure/contrib/classpath.clj (or the > equiva

Re: newbie question about ns and :require

2010-01-25 Thread Manfred Lotz
On Sun, 24 Jan 2010 12:28:16 -0800 (PST) Justin Kramer wrote: > You may find this ns cheatsheet helpful: > > http://gist.github.com/284277 > > Justin > A good pointer. -- Thanks, Manfred -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: newbie question about ns and :require

2010-01-25 Thread Manfred Lotz
Hi, On Sun, 24 Jan 2010 17:07:23 +0100 Meikel Brandmeyer wrote: > > > But why does this fail? > > > > my=> (classpath) > > java.lang.Exception: Unable to resolve symbol: classpath in this > > context (NO_SOURCE_FILE:2) > > Because you used require. Try clojure.contrib.classpath/classpath > i

newbie question about ns and :require

2010-01-24 Thread Manfred Lotz
Hi all, I'm stumbling about the very basics. Calling clojure like this: rlwrap java -cp /home/manfred/clojure/clojure.jar:/home/manfred/clojure/clojure-contrib.jar clojure.main I try: user=> (ns my (:require clojure.contrib.classpath)) nil my=> which to me looks fine. But why does this fai