forward decls / autodef?

2009-10-08 Thread Raoul Duke
hi, are there any plans to something along the lines of e.g. having autodef be something that can be turned on per-file via some expression in the file itself? thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Data structure design question

2009-10-08 Thread Timothy Pratley
On Oct 9, 1:21 pm, Robert Luo wrote: > Hi, I am working on a server project, which requires thousands records Just FYI this came up a while ago: http://groups.google.com/group/clojure/browse_thread/thread/8c09cab025a716f4 I'm very interested in this also - if it has been progressed in any way.

Re: ANN: scriptjure, a library for generating javascript

2009-10-08 Thread Allen Rohner
> Did you try > (defmulti emit class) ? That is a good point. I'm actually not sure why I used type there. It's probably a bug. Thanks for pointing it out. Allen On Oct 8, 4:38 am, Emeka wrote: > Allen, > Great job! > > > Regards, > Emeka > > > > On Thu, Oct 8, 2009 at 7:18 AM, Meikel Brandmey

Re: ANN: scriptjure, a library for generating javascript

2009-10-08 Thread Allen Rohner
It was a minor thing actually, I didn't like having to quote "user" code, and AFAIK, it's not possible to add a quasiquote as part of a macro. i.e. in my code, there is a function (_js) that does the heavy lifting, and the macro (js). I couldn't write: (defmacro js [forms] (quasiquote (_js for

Data structure design question

2009-10-08 Thread Robert Luo
Hi, I am working on a server project, which requires thousands records of data stored in memory, and they will be accessed by thousands of threads simultaneously. I intend to use datalog to store all my data, sharing the whole database by a reference. However, I am afraid of concurrency of this de

Re: Agents for managing threads

2009-10-08 Thread John Harrop
On Thu, Oct 8, 2009 at 7:49 PM, John Harrop wrote: > You might be able to do better than that, and dispense entirely with the > separate polling thread. > Confirmed: (def x (agent {:polling false :message "foo"})) (defn poll [m] (when (:polling m) (prn (:message m)) (Thread/sleep 100

Re: Agents for managing threads

2009-10-08 Thread John Harrop
On Thu, Oct 8, 2009 at 1:06 PM, Laurent PETIT wrote: > So I don't think you need this message-queue at all (or maybe I haven't > understood what it is or I'm mislead by its name), send directly your order > to the agent as what you want to change in its state. You might be able to do better than

Re: What does this error mean?

2009-10-08 Thread John Harrop
On Thu, Oct 8, 2009 at 11:09 AM, Mark Tomko wrote: > Can you give some more context? The pesky thing about that particular error is that there IS no more context; it fingers no specific line of code, function definition, or whatever as culprit. --~--~-~--~~~---~--~-

Re: What does this error mean?

2009-10-08 Thread John Harrop
On Thu, Oct 8, 2009 at 9:38 AM, kunjaan wrote: > > java.lang.ClassFormatError: Unknown constant tag 52 in class file > queries__init (Trial.clj:0) It seems to be an infrequently-encountered bug in load-file. If you copy and paste the source code into the REPL and hit enter, it will evaluate the

Re: Another defmult VS defn query

2009-10-08 Thread John Harrop
On Thu, Oct 8, 2009 at 10:25 AM, Robert Stehwien wrote: > (defn mv2 [from to] > (let [f (if (= (class from) File) from (File. from)) > t (if (= (class to) File) from (File. to))] > (println "transformed to File"))) > ITYM t (if (= (class to) File) to (File. to))] for that

Re: Basic questions

2009-10-08 Thread Stuart Sierra
On Oct 8, 1:49 am, vishy wrote: > How can I find out all the namespaces in a library like clojure.contrib.find-namespaces has functions to discover namespaces on the classpath. -SS --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: What does this error mean?

2009-10-08 Thread eyeris
What JDK/JRE version? On Oct 8, 8:38 am, kunjaan wrote: > java.lang.ClassFormatError: Unknown constant tag 52 in class file > queries__init (Trial.clj:0) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" grou

Re: Agents for managing threads

2009-10-08 Thread Laurent PETIT
I'm not an expert on asynchronicity with clojure, but I'll benefit from the fact i'll be the first to answer :-) But please take this with a grain of salt. As I see agents, in their generality, they are "a generic way to handle a state asynchronously (commands from multiple non organized sources -

Agents for managing threads

2009-10-08 Thread Garth Sheldon-Coulson
Hi All, This is a question about whether I can use agents or some other Clojure concurrency feature to manage a multithreaded process elegantly and extensibly. The following is a thought I had for how to do it, but I would appreciate additional suggestions. I have an application that needs to pol

Re: Another defmult VS defn query

2009-10-08 Thread Robert Stehwien
On Thu, Oct 8, 2009 at 9:45 AM, Tom Faulhaber wrote: > > Check out clojure.contrib.duck-streams/reader and clojure.contrib.duck- > streams/writer (http://richhickey.github.com/clojure-contrib/duck- > streams-api.html). > > They'll give you a java.io.BufferedReader or a java.io.PrintWriter > which

Re: Another defmult VS defn query

2009-10-08 Thread Tom Faulhaber
Check out clojure.contrib.duck-streams/reader and clojure.contrib.duck- streams/writer (http://richhickey.github.com/clojure-contrib/duck- streams-api.html). They'll give you a java.io.BufferedReader or a java.io.PrintWriter which is usually what you want with a file. If you have some other use,

Re: What does this error mean?

2009-10-08 Thread Mark Tomko
Can you give some more context? On Oct 8, 6:38 am, kunjaan wrote: > java.lang.ClassFormatError: Unknown constant tag 52 in class file > queries__init (Trial.clj:0) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clo

Re: Another defmult VS defn query

2009-10-08 Thread lpetit
Oh, maybe this as-file method already exists in clojure.contrib, honestly I don't know and don't have the time to search right now, regards, -- laurent On 8 oct, 16:41, Laurent PETIT wrote: > Suggestion : > > move and generalize the problem by creating an as-file multifn that may take > String

Re: Another defmult VS defn query

2009-10-08 Thread Laurent PETIT
Suggestion : move and generalize the problem by creating an as-file multifn that may take String, File , and maybe other things later ... (defmulti as-file type) (defmethod as-file String [from] (File. from)) (defmethod as-file File [from] from) (defn mv [from to] (let [ [from to] (map as-file

Another defmult VS defn query

2009-10-08 Thread Robert Stehwien
Here is another question on when you would use a multi-method. I want the mv function to accept a java.io.File or a String for either of the two parameters and here are the options I came up with: -(defmulti mv (fn [from to] [(class from) (class to)])) (defmethod mv [String String] [from to]

What does this error mean?

2009-10-08 Thread kunjaan
java.lang.ClassFormatError: Unknown constant tag 52 in class file queries__init (Trial.clj:0) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.

Pleas help me fix my code which retrieves the web page. It is running out of memory space.

2009-10-08 Thread kunjaan
(ns Trial (:use queries) (:import (java.io BufferedReader IOException InputStreamReader) java.net.URL javafiles.Porter)) ;; (def *server* "fiji4.ccs.neu

Re: Mutating state in java super classes

2009-10-08 Thread C. Florian Ebeling
>> Neither gen-class nor proxy seem to mention how one can access or >> mutate member variables.  I would have thought instance variables >> would be accessible and mutatable within some kind of binding... > > gen-class has an :exposes option that allows you to create > getter and setter methods f

Re: read-line in emacs slime on windows problem

2009-10-08 Thread DanL
On 7 Okt., 20:34, Phil Hagelberg wrote: > [...] it's simply not supported [...] I'm pretty sure that it used to work some time ago. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gro

Re: ANN: scriptjure, a library for generating javascript

2009-10-08 Thread Emeka
Allen, Great job! Did you try (defmulti emit class) ? Regards, Emeka On Thu, Oct 8, 2009 at 7:18 AM, Meikel Brandmeyer wrote: > > Hi, > > On Oct 8, 7:50 am, Jarkko Oranen wrote: > > > I took a quick look, and that looks really neat. One thing though: > > Instead of the "clj" form to escape ba

New list for the clojure-maven-plugin

2009-10-08 Thread Mark Derricutt
'lo all, Just to let you all know I've created a list specifically for the clojure-maven-plugin project at: http://groups.google.com/group/clojure-maven-plugin Mark -- Pull me down under... --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: swap! and dosync

2009-10-08 Thread Timothy Pratley
Quite right that is an important distinction. On Oct 8, 5:21 pm, Krukow wrote: > On Oct 8, 3:43 am, Timothy Pratley wrote: > > > Atoms can't do this, as they are synchronous (called and returned > > immediately) - hence the warning about potentially being called > > multiple times. > > The rea

Re: Basic questions

2009-10-08 Thread Alex Osborne
vishy wrote: > How can I find out all the namespaces in a library like > clojure.contrib. I assume you mean doing this at the REPL or OS shell. I don't know how to do it for non-loaded libs, aside from manually walking the classpath, but (all-ns) might be what you want for loaded namespaces.

Re: Basic questions

2009-10-08 Thread Miron Brezuleanu
Hello, On Thu, Oct 8, 2009 at 8:49 AM, vishy wrote: > How can I find out all the namespaces in a library like > clojure.contrib.Also, how to find all the functions defined in a > namespace? Are there any commands which I can use on commandline? You can use http://github.com/mmcgrana/clj-doc on