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

Re: dtd question

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

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 randy_hud...@mac.com wrote: Yes, you can do this by defining an EntityResolver that corrects the

Re: dtd question

2010-08-01 Thread Manfred Lotz
Hi Randy, On Sun, 1 Aug 2010 06:23:58 -0700 (PDT) Randy Hudson randy_hud...@mac.com 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))

Re: dtd question

2010-08-01 Thread Manfred Lotz
Hi Randy, On Sun, 1 Aug 2010 10:04:16 -0700 (PDT) Randy Hudson randy_hud...@mac.com 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

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

Re: Leiningen documentation review?

2010-06-17 Thread Manfred Lotz
Hi Phil, On Wed, 16 Jun 2010 21:24:55 -0700 Phil Hagelberg p...@hagelb.org 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,

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 snip-- (defproject example 0.1

Re: nailgun: simple example problem

2010-04-10 Thread Manfred Lotz
Hi Phil, On Sat, 10 Apr 2010 09:54:29 -0700 Phil Hagelberg p...@hagelb.org wrote: On Sat, Apr 10, 2010 at 3:27 AM, Manfred Lotz manfred.l...@arcor.de wrote: snip-- (defproject example 0.1    :description Example

Re: nailgun: simple example problem

2010-04-10 Thread Manfred Lotz
On Sat, 10 Apr 2010 15:10:58 -0700 Brendan Ribera brendan.rib...@gmail.com 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

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: fn? question

2010-04-04 Thread Manfred Lotz
Hi Per, On Sun, 4 Apr 2010 15:28:23 +0700 Per Vognsen per.vogn...@gmail.com 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

Re: Default value for structure

2010-03-07 Thread Manfred Lotz
On Sun, 7 Mar 2010 12:35:27 +0800 Mike Mazur mma...@gmail.com wrote: Hi, On Sat, Mar 6, 2010 at 20:36, Manfred Lotz manfred.l...@arcor.de wrote: Now I tried a different way: (defstruct st :a :b) (defn my-struct-map [s inits]  (let [sm (struct-map s inits)]    (if (= nil (sm :b

Re: Default value for structure

2010-03-06 Thread Manfred Lotz
On Mon, 1 Mar 2010 11:01:36 -0800 (PST) ataggart alex.tagg...@gmail.com 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

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

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 m...@kotka.de 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

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 jkkra...@gmail.com 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

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