Re: agent questions - DOS - asynchrony - protection

2009-06-11 Thread Daniel Lyons
On Jun 10, 2009, at 11:23 PM, Robert Lehr wrote: >> As you noted, send-off uses a cached thread pool, so there is no >> protection from creating more threads than your system can handle > > OK - that's one person that agrees w/ me. I don't think anyone disagrees on that point. >> In general ca

Re: Reminder: Bay Area Clojure User Group meeting in SF during JavaOne (6/3) with Rich Hickey

2009-06-11 Thread Konrad Hinsen
On 11.06.2009, at 08:54, Alex wrote: > Just wanted to say I had a great time at the meetup. Really fun to > see people using Clojure in earnest and hear Rich talk about stuff. I > blogged it a bit here: > > http://tech.puredanger.com/2009/06/10/clojure-rich-hickey/ Thanks for the notes! There i

How difficult would creating a collaborative multi-user online virtual world application be in Clojure?

2009-06-11 Thread Benjamin L . Russell
One question that has been coming up at the back of my mind for the past several weeks has been how difficult would it be to create a collaborative multi-user online virtual world application in a semi-functional programming language, such as Clojure. More specifically, last August, I came across

Updating a running app

2009-06-11 Thread rb
HI, in his post "Macro design, by example" [1], Meikel Brandmeyer mentioned that it is possible to reload a function (in contrast to a macro) in a running application: "Now all you have to do is to just reload the single function in the running application. This can be easily done by environment

Re: How difficult would creating a collaborative multi-user online virtual world application be in Clojure?

2009-06-11 Thread Krešimir Šojat
Hi, Take a look at project Wonderland -- https://lg3d-wonderland.dev.java.net/ -- Krešimir Šojat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googleg

Re: (re)setting a function globally

2009-06-11 Thread Stuart Halloway
Matt is signing the CA and I will be adding test-expect to contrib. Stu > > Can I help from the test-is side? Could test-expect be added to > clojure-contrib? > -Stuart > > > On Jun 10, 1:36 pm, Matt Clark wrote: >> Thanks for these ideas, I will give them a try tonight and update the >> adapt

Contributing to Clojure CLR.

2009-06-11 Thread mmwaikar
Hi, How can one contribute to the development of Clojure on CLR? I was trying the following - (.ToString DateTime/Now) and was getting - "System.Exception: Unable to find static field: Now in System.DateTime". I added some code in Reflector.cs, Compiler.cs and StaticFieldExpr.cs and got it work

Anyone planning on using Clojure for ICFP 2009?

2009-06-11 Thread Seth
So the 12th International Conference on Functional Programming is coming up soon. A few months before the event a programming contest is held, typically with very ambitious requirements in a short period of time (2-3 days). The 2009 contest will be held from Friday 26 to Monday 29 June and I would

do-asynch-periodically

2009-06-11 Thread Wrexsoul
Consider this public domain for copyright purposes. Try it at the repl with: (defn make-counter [] (let [i (atom 0)] #(do (swap! i + 1) @i))) (def *counter* (make-counter)) (do-asynch-periodically *xxx* 1 (println (*counter*))) (do-asynch-periodically *xxx* 1 (println (str "changed! " (*counter*

Re: Clojure at LispNYC tonight 7pm

2009-06-11 Thread Baishampayan Ghose
Stuart Sierra wrote: > On Jun 9, 10:32 am, Stuart Sierra wrote: >> Join us Tuesday, June 9 from 7:00-9:00 for Stuart Sierra's >> presentation: >> >> Implementing AltLaw.org in Clojure > > Slides and video here: http://lispnyc.org/wiki.clp?page=past-meetings > We'll try to get something lighte

Re: Updating a running app

2009-06-11 Thread Shawn Hoover
On Thu, Jun 11, 2009 at 5:06 AM, rb wrote: > > HI, > > in his post "Macro design, by example" [1], Meikel Brandmeyer > mentioned that it is possible to reload a function (in contrast to a > macro) in a running application: > > "Now all you have to do is to just reload the single function in the >

Re: agent questions - DOS - asynchrony - protection

2009-06-11 Thread Toralf Wittner
On Wed, 2009-06-10 at 22:23 -0700, Robert Lehr wrote: > Given that this will only occur w/ the send-off function, we can guess > that the tasks may on-average longer than functions that could be sent > via "send". that is b/c send-off is recommended for functions that > could block. That could b

Clojure performance and timings

2009-06-11 Thread Frantisek Sodomka
Hello all! After reading this article: Clojure performance tips http://gnuvince.wordpress.com/2009/05/11/clojure-performance-tips/ I wrote a macro to better compare different timings of functions and expressions: (defmacro time-ms [n expr] `(let [start# (. System (nanoTime))] (dotimes [i#

Re: Contributing to Clojure CLR.

2009-06-11 Thread Paul Stadig
I believe David Miller is the one who wrote the CLR code, and he is still hacking on it when he has time. In addition to what is checked into contrib there is also this: http://github.com/dmiller/ClojureCLR/tree/master I'm not sure if they are in sync or which is the most current (github may be

Re: Contributing to Clojure CLR.

2009-06-11 Thread Rich Hickey
On Jun 11, 9:57 am, Paul Stadig wrote: > I believe David Miller is the one who wrote the CLR code, and he is still > hacking on it when he has time. > > In addition to what is checked into contrib there is also this: > > http://github.com/dmiller/ClojureCLR/tree/master > > I'm not sure if they

Re: Anyone planning on using Clojure for ICFP 2009?

2009-06-11 Thread Matt Culbreth
I'm going to do what I did last year: 1. Learn a functional language (Clojure this year; OCaml last year). 2. Try to do the the problem in said new language. 3. Give up and switch to Python. :) On Jun 11, 1:54 am, Seth wrote: > So the 12th International Conference on Functional Progra

Simple idiom in clojure, mutate a value

2009-06-11 Thread BerlinBrown
I do this a lot but can't figure out to change the UPDATEABLE_VALUE, I am using some pseudo code because I don't have a clojure solution yet. SET UPDATEABLE_VALUE = 0 (loop [line (.readLine reader)] (if (or (empty? line) (> line-num max-num)) SET UPDATEABLE_VALUE = UPDATEABLE_VALUE

Re: Simple idiom in clojure, mutate a value

2009-06-11 Thread David Nolen
Not totally clear what you are trying to accomplish, but would something like the following work? (defn get-value [start-value] (loop [updateable start-value line (.readline reader)] (if (or (empty? line) (> line-num max-num)) (+ updateable (somefunc)) (recur (.readLine reader)))

Re: Anyone planning on using Clojure for ICFP 2009?

2009-06-11 Thread Daniel Lyons
On Jun 10, 2009, at 6:54 PM, Seth wrote: > > So the 12th International Conference on Functional Programming is > coming up soon. A few months before the event a programming contest is > held, typically with very ambitious requirements in a short period of > time (2-3 days). The 2009 contest will

Re: Simple idiom in clojure, mutate a value

2009-06-11 Thread Daniel Lyons
On Jun 11, 2009, at 9:25 AM, BerlinBrown wrote: > > I do this a lot but can't figure out to change the UPDATEABLE_VALUE, I > am using some pseudo code because I don't have a clojure solution yet. > > SET UPDATEABLE_VALUE = 0 > (loop [line (.readLine reader)] > (if (or (empty? line) (> line-

PermGen OutOfMemory error

2009-06-11 Thread Rob
Hi all, I'm using Clojure for web apps inside Tomcat. If I don't compile my .clj files ahead of time, I will eventually get one of these OutOfMemory errors, after a number of redeployments. Is there something I can do about this? Is this a bug somewhere, in my code, or in Clojure, or in Tomcat

catching exception error

2009-06-11 Thread peg
Hi clojurians, I was happily clojure-coding whent I tried to catch a exception in a thrown deeply in a function. After looking for the fact that the IllegalArgumentException wasn't catch, I added a catch RuntimeException to my catch list ... and that worked of course. Here is the simplified cas

Re: Simple idiom in clojure, mutate a value

2009-06-11 Thread Berlin Brown
On Jun 11, 12:16 pm, Daniel Lyons wrote: > On Jun 11, 2009, at 9:25 AM, BerlinBrown wrote: > > > > > I do this a lot but can't figure out to change the UPDATEABLE_VALUE, I > > am using some pseudo code because I don't have a clojure solution yet. > > > SET UPDATEABLE_VALUE = 0 > > (loop [line (

Re: PermGen OutOfMemory error

2009-06-11 Thread hughw
On Jun 11, 11:38 am, Rob wrote: > Hi all, > > I'm using Clojure for web apps inside Tomcat.  If I don't compile > my .clj files ahead of time, I will eventually get one of these > OutOfMemory errors, after a number of redeployments.  Is there > something I can do about this?  Is this a bug some

Re: Simple idiom in clojure, mutate a value

2009-06-11 Thread David Nolen
Why isn't the following satisfactory for your needs? get-value takes a value returns a new value based on it. do-something can 'do something' to/with this new value. (defn get-value [start-value] (loop [updateable start-value line (.readline reader)] (if (or (empty? line) (> line-num max-num

Re: Simple idiom in clojure, mutate a value

2009-06-11 Thread Adrian Cuthbertson
You could do something like; (let [updated-val (loop [updateable start-value line (.readline reader)] (if (or (empty? line) (> line-num max-num)) (+ updateable (somefunc)) (recur (.readLine reader)] (do-something with updated-val)) Rgds, Adrian. On Thu, Jun 11, 2009 at 8:34

Re: Simple idiom in clojure, mutate a value

2009-06-11 Thread Adrian Cuthbertson
Re-read your example - that should have been; (let [updated-val (loop [updateable 0 line (.readline reader)] (if (or (empty? line) (> line-num max-num)) (+ updateable (somefunc)) (recur (.readLine reader)] (do-something-with updated-val)) I.e initialising updateable to 0. On

Re: catching exception error

2009-06-11 Thread Luc Prefontaine
The Clojure run time throws IllegalArgumentException in a lot of different places. It does also throw RuntimeException in several places. It traps exceptions generically (catch (Exception e), catch (Throwable t) ) and may have thrown a RuntimeException back to upper layers instead of the original\

Re: Simple idiom in clojure, mutate a value

2009-06-11 Thread Adrian Cuthbertson
Here's a fuller example of similar techniques extracted from a working program. It reads a file of lines and applies some transformations and accumulates a vector of records which it finally returns; (defn some-fn "Read a file and return a vector of its records." [fpath] (let [r (Buffer

Re: Contributing to Clojure CLR.

2009-06-11 Thread David Miller
Yes to all of the above. Github will always be the most current version. I'm rolling changes out to contrib on a less frequent basis. for, improve, post a pull on github is way to go. And CA definitely required. On Jun 11, 10:14 am, Rich Hickey wrote: > On Jun 11, 9:57 am, Paul Stadig wro

Re: Status of Clojure on .NET?

2009-06-11 Thread John "Z-Bo" Zabroski
On Jun 11, 12:11 am, David Miller wrote: > Improving the performance of ClojureCLR is in the top two development > goals.  (Porting to Mono is the other.) Are you familiar with Mono and the recent attempts from the Mono developers to make the VM more functional programming language friendly,

Re: Simple idiom in clojure, mutate a value

2009-06-11 Thread Mike Hinchey
Adrian and David are suggesting how to work functionally, which is best when appropriate. Berlin, if you really need state modified over time, Clojure does this differently from most languages. Values never change, only references to values and only in controlled ways. Maybe what you want is a r

Re: Simple idiom in clojure, mutate a value

2009-06-11 Thread Chouser
On Thu, Jun 11, 2009 at 3:03 PM, Adrian Cuthbertson wrote: > > Here's a fuller example of similar techniques extracted from a working > program. It reads a file of lines and applies some transformations and > accumulates a vector of records which it finally returns; > > (defn some-fn >  "Read a fi

LWN article on clojure and vala

2009-06-11 Thread raybaq
here: http://lwn.net/Articles/335966/ enjoy, Ray --~--~-~--~~~---~--~~ 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 mod

Re: Simple idiom in clojure, mutate a value

2009-06-11 Thread Berlin Brown
On Jun 11, 3:42 pm, Chouser wrote: > On Thu, Jun 11, 2009 at 3:03 PM, Adrian > > > > Cuthbertson wrote: > > > Here's a fuller example of similar techniques extracted from a working > > program. It reads a file of lines and applies some transformations and > > accumulates a vector of records whi

Lazy load of imports

2009-06-11 Thread BerlinBrown
I have a Clojure applications with different files, different namespaces and I have imports of classes within those files/ namespaces. lets say (import java.io File) (import thepackage SomeClass) Is it possible to lazy load the imports of the class. For example, if I start my app, I will get a

Re: PermGen OutOfMemory error

2009-06-11 Thread Allen Rohner
I haven't hit the permgen issue, but it sounds like I have a similar setup to you. Out of curiosity, how do you redeploy while compiling your .clj files? I typically connect via Slime and use slime-load- file, which I assume calls (load filename) Allen On Jun 11, 1:23 pm, hughw wrote: > On Jun

Re: Lazy load of imports

2009-06-11 Thread Stephen C. Gilardi
On Jun 11, 2009, at 2:30 PM, BerlinBrown wrote: I have a Clojure applications with different files, different namespaces and I have imports of classes within those files/ namespaces. I don't think the following is exactly what you're asking for, but you can use "clojure.contrib.core/new-by-

Re: How is Clojure API reference generated?

2009-06-11 Thread Tom Faulhaber
Rich posted the code he uses here: http://paste.lisp.org/display/77339 But note that he's building it in wiki markup and not html. HTH, Tom On Jun 9, 4:13 pm, Nicolas Buduroi wrote: > Hi, I'm wondering how Clojure API reference page is generated? I'd > like to adapt it for the future Compojur

Re: Lazy load of imports

2009-06-11 Thread Berlin Brown
On Jun 11, 6:51 pm, "Stephen C. Gilardi" wrote: > On Jun 11, 2009, at 2:30 PM, BerlinBrown wrote: > > > I have a Clojure applications with different files, different > > namespaces and I have imports of classes within those files/ > > namespaces. > > I don't think the following is exactly what

Re: Lazy load of imports

2009-06-11 Thread Stephen C. Gilardi
On Jun 11, 2009, at 5:20 PM, Berlin Brown wrote: Now, that is close, not entirely but close enough. Cool. Do you think there will be any performance hits. I haven't run any tools on it. In looking around the reflection- related code in clojure.lang, it looks to me like the performance of

Clojure Decompiled

2009-06-11 Thread George Jahad
I was looking for a way to make my understanding of Clojure's code generation more concrete. What actually does execute when you run a Clojure function? These are notes based on my talk at the Bay Area Clojure meetup last week: http://georgejahad.com/clojure/clojureDecompiled.html --~--~--

Re: (re)setting a function globally

2009-06-11 Thread Matt Clark
The agreement is signed and in the (snail) mail. Also, I think I found a solution to the original problem that spurred this thread. In the test-is-adapter namespace I have added an expect macro that wraps the standard expect macro with a binding for the test- is specific report-problem function.

Date Adapter Utility

2009-06-11 Thread Sean Devlin
Hey everyone, I'm looking for feedback on a date utility library I'm writing. It's still early in it's design, and I want to see if other people see anything. It's designed to create various forms of date objects. It's available on github here: http://github.com/francoisdevlin/devlinsf-clojure

Re: How is Clojure API reference generated?

2009-06-11 Thread Nicolas Buduroi
Great, exactly what we needed! On Jun 11, 7:51 pm, Tom Faulhaber wrote: > Rich posted the code he uses here:http://paste.lisp.org/display/77339 > > But note that he's building it in wiki markup and not html. > > HTH, > > Tom > > On Jun 9, 4:13 pm, Nicolas Buduroi wrote: > > > Hi, I'm wondering

Re: Contributing to Clojure CLR.

2009-06-11 Thread mmwaikar
What is CA? I've never used GitHub too so any help is greatly appreciated. On Jun 11, 3:24 pm, David Miller wrote: > Yes to all of the above. > > Github will always be the most current version.   I'm rolling changes > out to contrib on a less frequent basis. > > for, improve, post a pull on gith

Re: Contributing to Clojure CLR.

2009-06-11 Thread David Miller
CA = Contributor Agreement. See http://clojure.org/contributing Github help is fairly extensive: http://github.com/guides/home On Jun 11, 8:28 pm, mmwaikar wrote: > What is CA? I've never used GitHub too so any help is greatly > appreciated. > > On Jun 11, 3:24 pm, David Miller wrote: > > >