Re: Extending Java class in Clojure with multiple constructors

2010-04-18 Thread Stephan Mühlstrasser
On 18 Apr., 01:51, David McNeil wrote: > My question is: is there a better way to accomplish this, perhaps > using a mechanism other than proxy? > You can do that with gen-class: http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/gen-class. "... By default, constructors a

Running compojure in clojure eclipse plugin

2009-06-26 Thread Stephan Mühlstrasser
Hi, I'm not really familiar with compojure, but I was able to run Compojure in the REPL inside of the clojure eclipse plug-in by using the steps described under http://en.wikibooks.org/wiki/Compojure/Getting_Started as a guideline: - Built compojure from source as it is described under "Build fr

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-23 Thread Stephan Mühlstrasser
I think there are too many of the "j" names already. I thought about leveraging a hint to the REPL. What about calling it "REPtiLe"? This could also provide an idea for a logo derived from the Clojure logo, with a snake or a lizard instead of the lambda. Regards Stephan On 23 Jun., 13:47, Lauren

Problem with clojure.xml/emit: unnecessary whitespace added

2009-02-18 Thread Stephan Mühlstrasser
clojure.xml/emit adds newlines before and after the content of an element, and as far as I can see there is no way to suppress it: user=> (use 'clojure.xml) nil user=> (emit {:tag :a, :content ["b"]}) b nil As whitespace within XML elements is significant, I think that emit should not add new

Bug in clojure.contrib.lazy-xml: apostrophe not escaped correctly

2009-02-18 Thread Stephan Mühlstrasser
Hi, I believe the following is a bug in clojure.contrib.lazy-xm: user=> (use 'clojure.contrib.lazy-xml) nil user=> (emit { :tag :a, :attrs { :b "bloody apostrophe's :-)" }}) nil The XML is broken, because the embedded apostrophe in attribute b is not replaced with an XML entity. The apostrop

Re: (Ab)using agents for inter-process communication

2008-12-18 Thread Stephan Mühlstrasser
On Dec 18, 11:30 pm, Randall R Schulz wrote: > On Thursday 18 December 2008 13:33, Stephan Mühlstrasser wrote: > > > Nothing fancy: > > (defn cat-stream > >   (.flush *out*))) > As Chouser pointed out, the flush is the important ingredient. After thinking a whil

Re: (Ab)using agents for inter-process communication

2008-12-18 Thread Stephan Mühlstrasser
On Dec 18, 10:01 pm, Randall R Schulz wrote: > > > My question was not precise enough. I meant why can the parent > > process - the Clojure program - terminate before all all the output > > has been passed through. > > Because it can terminate whenever it wants to. Child processes do not > place

Re: (Ab)using agents for inter-process communication

2008-12-18 Thread Stephan Mühlstrasser
On Dec 18, 10:10 pm, Chouser wrote: > On Thu, Dec 18, 2008 at 3:07 PM, Stephan Mühlstrasser > > wrote: > > > The following is my attempt to start a sub-process and to pass through > > stdout and stderr.  The shell command prints out 1000 lines "hello" >

Re: (Ab)using agents for inter-process communication

2008-12-18 Thread Stephan Mühlstrasser
On Dec 18, 9:24 pm, Randall R Schulz wrote: > On Thursday 18 December 2008 12:07, Stephan Mühlstrasser wrote: > > > (let [pb (new ProcessBuilder ["sh" "-c" "yes hello | head -1000; echo > > command finished"]) > >         proc (.star

(Ab)using agents for inter-process communication

2008-12-18 Thread Stephan Mühlstrasser
Hi, I've not yet seen any examples on how to deal with external processes in Clojure (I hope I didn't overlook something in clojure-contrib). The following is my attempt to start a sub-process and to pass through stdout and stderr. The shell command prints out 1000 lines "hello" and a final "co

Re: Lazy sequences without caching?

2008-12-09 Thread Stephan Mühlstrasser
On Dec 9, 8:48 pm, "Drew Olson" <[EMAIL PROTECTED]> wrote: > On Tue, Dec 9, 2008 at 2:28 PM, Stephan Mühlstrasser < > > [EMAIL PROTECTED]> wrote: > > > On Dec 9, 12:34 am, "harrison clarke" <[EMAIL PROTECTED]> wrote: > > > y

Re: Lazy sequences without caching?

2008-12-09 Thread Stephan Mühlstrasser
On Dec 9, 12:34 am, "harrison clarke" <[EMAIL PROTECTED]> wrote: > you're keeping the head of the sequence, and thus all the elements between > the head and nth. > > it's because you're using def, basically. > > if you make a function to return the sequence, and pass the result directly > to nth,

Lazy sequences without caching?

2008-12-08 Thread Stephan Mühlstrasser
Hi, for one of the problems from Project Euler I implemented a "triangle numbers" lazy sequence after the blueprint of the fibonacci numbers sequence in clojure.contrib.lazy-seqs:. When taking large numbers of items from this equence, I get an out-of-memory exception: user=> (def triangle-numbe

ants.clj: question about sleep in dosync

2008-11-19 Thread Stephan Mühlstrasser
Hi, first of all hello to everybody as I'm new to this group. I'm starting to learn Clojure, and therefore I studied the ants.clj program. It's more or less clear to me how it works, but I stumbled across a small detail that made me wonder. In the "behave" function for the ant agent, there's th