Hints/link for file layout in a clojure project

2009-10-12 Thread Ranjan Bagchi
Hi -- I'm doing some development in Clojure using SLIME. My project involves some files which are called as scripts and the majority of code which is in a library, probably structured in a bunch of files corresponding to various responsibilities. I'm trying to figure out the best way to structu

Re: third party libraries and agents shutdown

2009-10-12 Thread Chouser
On Mon, Oct 12, 2009 at 3:28 PM, Rob Wolfe wrote: > > Let's suppose I don't know that there have been used agents here. > This program will hang, because I haven't added "shutdown-agents" call. > What do you do in such case: > a) take a look at the library code to find out if there are used agent

Re: Proposal: New Reader Macro #s{ ... }

2009-10-12 Thread Jeff Valk
If a keeping syntax simple and singular is the goal, the reader macro could use the proposed #s{ ... } form, while supporting balanced braces in the verbatim text. The text literal would close when the number of closing braces matches the number of opening braces. Strings containing unmatched b

Re: Dynamically building and evaluating s-expressions from Java

2009-10-12 Thread John Harrop
On Mon, Oct 12, 2009 at 6:55 PM, Garth Sheldon-Coulson wrote: > Yes, but for present purposes I'm stuck in Java proper. > > I'll try using Clojure's compile to build a Java class with a method that > builds an s-expression based on its arguments and evals it. If this works it > will be simpler th

Re: Dynamically building and evaluating s-expressions from Java

2009-10-12 Thread Garth Sheldon-Coulson
Yes, but for present purposes I'm stuck in Java proper. I'll try using Clojure's compile to build a Java class with a method that builds an s-expression based on its arguments and evals it. If this works it will be simpler than constructing clojure.lang.* objects and Compile.eval()ing them. On Mo

Re: Dynamically building and evaluating s-expressions from Java

2009-10-12 Thread John Harrop
On Mon, Oct 12, 2009 at 5:10 PM, Garth Sheldon-Coulson < garth.sheldoncoul...@gmail.com> wrote: > Rich wrote somewhere that he wanted to make it possible for Java > applications to build Clojure s-expressions dynamically and pass them to an > embedded Clojure compiler/evaluator. > > I'm not talkin

Re: Proposal: New Reader Macro #s{ ... }

2009-10-12 Thread John Harrop
On Mon, Oct 12, 2009 at 4:21 PM, Greg wrote: > My only concern, and perhaps John could elaborate on this because he > touched on it, would be how are Java nested classes protected from > this? Wouldn't it interfere with them? Or will the delimiters be > restricted to non-alphanumeric characters?

Re: Watching a directory for new files

2009-10-12 Thread Axis43
Many thanks. As its only an exercise at this stage to get my head around the whole functional programming thing, a linux solution is good for me. On Oct 12, 10:42 pm, Chouser wrote: > On Mon, Oct 12, 2009 at 7:27 AM, Axis43 wrote: > > > As an exercise I am moving some stuff I wrote in c# to C

Re: Dynamically building and evaluating s-expressions from Java

2009-10-12 Thread Garth Sheldon-Coulson
Scratch this until further notice. I've found http://groups.google.com/group/clojure/browse_thread/thread/81383e59e65d54c/809aaad743aed9ff?q=embedded+group:clojure+rt#809aaad743aed9ff http://groups.google.com/group/clojure/browse_thread/thread/d98cedb860f16a34/be7d6789964ec9c4?q=embedded+group:cl

Re: Agents for managing threads

2009-10-12 Thread John Harrop
Thanks. --~--~-~--~~~---~--~~ 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 moderated - please be patient with your first

Re: Proposal: New Reader Macro #s{ ... }

2009-10-12 Thread André Ferreira
Lua's solution to long strings is having multiple levels of delimiters. [[ is the opening delimiter of level 0, and is closed by ]] . [=[ is of level 1, closed by ]=] , etc. No matter what string you are trying to represent, it can always be literally represented that way. On 12 out, 17:25, Greg

Dynamically building and evaluating s-expressions from Java

2009-10-12 Thread Garth Sheldon-Coulson
Rich wrote somewhere that he wanted to make it possible for Java applications to build Clojure s-expressions dynamically and pass them to an embedded Clojure compiler/evaluator. I'm not talking about evaluating strings of Clojure-syntax text. I'm talking about building up the actual s-expressions

Re: Proposal: New Reader Macro #s{ ... }

2009-10-12 Thread Greg
Ah, I think I understand... but if you're saying that this should be something that can be done on an individual basis I think that's a bad idea, it would lead to confusing looking code and inconsistencies. There should be an officially sanctioned .. whatever it is this thing is called. Tha

Re: Proposal: New Reader Macro #s{ ... }

2009-10-12 Thread Greg
On Oct 12, 2009, at 3:29 PM, Michael Wood wrote: > No, he's saying you could use $+ some string + or $% some string % or > $* some string * etc. to mean the same as " some string ", so the > thing immediately following the $ sign must not be a space, but could > be basically anything else. Ah,

Re: Dealing with StringTemplate template paths

2009-10-12 Thread paul wisehart
On Oct 12, 10:48 am, Baishampayan Ghose wrote: > Stuart Halloway wrote: > > We are using StringTemplate's ability to search the classpath. That   > > way, finding templates is just as easy (!?) as getting the classpath   > > right for executable bits. I believe this is the right approach for  

third party libraries and agents shutdown

2009-10-12 Thread Rob Wolfe
Hi, I'm wondering how do you guys use libraries, which use agents under the hood? Let's suppose I'd like to use "clojure.contrib.http.agent". My program might look like this: (ns eu.rwdev.html (:require [clojure.contrib.http.agent :as http]) (:import [java.net URL] [java.io Buff

Re: Proposal: New Reader Macro #s{ ... }

2009-10-12 Thread Michael Wood
2009/10/12 Greg : > > I'm not sure I follow what John is saying (some of the terminology is > unfamiliar to me, what the heck's a digraph? :p), but is he suggesting My understanding of a digraph is basically two characters that together represent one real character. e.g. if you type ^Ka' in Vim

Re: Proposal: New Reader Macro #s{ ... }

2009-10-12 Thread DanL
On 12 Okt., 20:46, Greg wrote: > Forgive me, but I'm unfamiliar with the readtable, are you just   > referring to where this syntax might be implemented? Or are you   > suggesting an alternative syntax? I'm suggesting that the readtable might be exposed to user changes as it is in CL, but only

Re: api html page not working in firefox?

2009-10-12 Thread Manuel Woelker
On Sun, Oct 11, 2009 at 11:29 PM, Raoul Duke wrote: > > it seems to get chopped off part way down the page for me, of late. > (it doesn't get chopped off in ie for me.) > As another datapoint, it's chopped of for me too, at "(last coll)". If I'd have to guess I'd say it's a firefox issue though,

Re: Statics in clojure.lang.RT

2009-10-12 Thread Manuel Woelker
On Mon, Oct 12, 2009 at 11:41 AM, Christophe Grand wrote: > > You can: simply load them using different class loaders -- this way you'll > have several RT. Yeah, that might work. I had hoped to get around dealing with multiple classloaders and calling the RT methods via Reflection, but I guess t

Re: Proposal: New Reader Macro #s{ ... }

2009-10-12 Thread Greg
Forgive me, but I'm unfamiliar with the readtable, are you just referring to where this syntax might be implemented? Or are you suggesting an alternative syntax? - Greg On Oct 12, 2009, at 11:20 AM, DanL wrote: > > I'm aware that this already has been discussed, and until recently I > was c

Re: Proposal: New Reader Macro #s{ ... }

2009-10-12 Thread Greg
I'm not sure I follow what John is saying (some of the terminology is unfamiliar to me, what the heck's a digraph? :p), but is he suggesting that $+ not be followed by a whitespace to count as a string? If so, I think that's undesirable as that is 1) confusing, and 2) limits the sorts of s

Hiring full-time work-at-home clojure/emacs dev

2009-10-12 Thread dysinger
We need to hire another full-time dev full time to work on a clojure project (distributed backend on clojure).  If you have sent us an email in the past, please try again.  We didn't hire anyone in September and we are over-due. We are interested in meeting people in the U.S. that can work from h

Re: File and Regex Utils

2009-10-12 Thread Robert Stehwien
> While doing some scripting and as a learning I put together some file and > regex utilities. Reading though parts of clojure-contrib was a great eye > opener. Still needs some cleanup, doc, and maybe a few more functions. I > could wrap all the java.io.File functions but most are just a thin w

Re: api html page not working in firefox?

2009-10-12 Thread Raoul Duke
>> it seems to get chopped off part way down the page for me, of late. >> (it doesn't get chopped off in ie for me.) > > You wouldn't happen to be tunneling to a proxy via PuTTY, would you? > I've seen that happen in the past to a lot of people. nope. (off-list i heard of another person having t

Re: problems installing vimclojure 2.1.2 over 2.1.0

2009-10-12 Thread Meikel Brandmeyer
Hi, On Oct 12, 5:13 pm, Albert Cardona wrote: > Shoot me: my local.properties said: > > vimdir = /home/user/.vim > > Instead of `albert`. > > Thank you Meikel and sorry for wasting your time. No problem! :) And you are right: VC needs some deinstall. Sincerely Meikel --~--~-~--~

Re: Proposal: New Reader Macro #s{ ... }

2009-10-12 Thread DanL
I'm aware that this already has been discussed, and until recently I was content with clojure not exposing the readtable, because of the inherent modular problems. However, for CL, a nice approach to readtables was lately released: http://trittweiler.blogspot.com/2009/10/ann-named-readtables-09.h

Re: problems installing vimclojure 2.1.2 over 2.1.0

2009-10-12 Thread Albert Cardona
Meikel Brandmeyer wrote: > Hi, > > On Oct 12, 4:56 pm, Albert Cardona wrote: > > >> /home/albert/Programming/vimclj/vimclojure-2.1.2/build.xml:182: >> Directory /home/user/.vim/autoload creation was not successful for an >> unknown reason >> > > I think I know the reason: /home/user does

Re: problems installing vimclojure 2.1.2 over 2.1.0

2009-10-12 Thread Meikel Brandmeyer
Hi, On Oct 12, 4:56 pm, Albert Cardona wrote: > /home/albert/Programming/vimclj/vimclojure-2.1.2/build.xml:182: > Directory /home/user/.vim/autoload creation was not successful for an > unknown reason I think I know the reason: /home/user does not exist.Since you are doing a custom install, co

Re: problems installing vimclojure 2.1.2 over 2.1.0

2009-10-12 Thread Albert Cardona
Meikel Brandmeyer wrote: > Hi Albert, > > On Oct 12, 4:24 pm, Albert Cardona wrote: > > >> /home/albert/vimclojure-2.1.2/build.xml:182: Directory >> /home/user/.vim/autoload creation was not successful for an unknown reason >> >> I wonder: there is no uninstall target in the ant xml file. Do I

Re: Dealing with StringTemplate template paths

2009-10-12 Thread Baishampayan Ghose
Stuart Halloway wrote: > We are using StringTemplate's ability to search the classpath. That > way, finding templates is just as easy (!?) as getting the classpath > right for executable bits. I believe this is the right approach for > production in the Java world. That worked! Many thanks S

Re: problems installing vimclojure 2.1.2 over 2.1.0

2009-10-12 Thread Meikel Brandmeyer
Hi Albert, On Oct 12, 4:24 pm, Albert Cardona wrote: > /home/albert/vimclojure-2.1.2/build.xml:182: Directory > /home/user/.vim/autoload creation was not successful for an unknown reason > > I wonder: there is no uninstall target in the ant xml file. Do I have to > manually uninstall the older

problems installing vimclojure 2.1.2 over 2.1.0

2009-10-12 Thread Albert Cardona
Hi, I'd like to upgrade vimclojure to 2.1.2. My system already has a workin 2.1.0 installation. I run ant without problems, but "ant install" complains that: Buildfile: build.xml install: do-windows-install: do-unix-install: do-custom-install: real-do-install: BUILD FAILED /home/albert/

Re: Statics in clojure.lang.RT

2009-10-12 Thread Christophe Grand
On Mon, Oct 12, 2009 at 1:41 PM, Roman Roelofsen < roman.roelof...@googlemail.com> wrote: > > 2009/10/12 Christophe Grand : > > On Mon, Oct 12, 2009 at 12:00 PM, Roman Roelofsen > > wrote: > >> > >> > Plus, if you use a shared loader for most interfaces, clojure > instances > >> > will > >> > be

Re: Watching a directory for new files

2009-10-12 Thread Chouser
On Mon, Oct 12, 2009 at 7:27 AM, Axis43 wrote: > > As an exercise I am moving some stuff I wrote in c# to Clojure. > > One part of the program I am porting watches a folder for new files of > a specified type using .Net's FileWatcher.  I was wondering if anyone > has done done something similar i

Re: Dealing with StringTemplate template paths

2009-10-12 Thread Stuart Halloway
We are using StringTemplate's ability to search the classpath. That way, finding templates is just as easy (!?) as getting the classpath right for executable bits. I believe this is the right approach for production in the Java world. Cheers, Stu > Hello, > > I am using StringTemplate with

Watching a directory for new files

2009-10-12 Thread Axis43
As an exercise I am moving some stuff I wrote in c# to Clojure. One part of the program I am porting watches a folder for new files of a specified type using .Net's FileWatcher. I was wondering if anyone has done done something similar in Clojure and/or can point me in the right direction to a s

Re: Statics in clojure.lang.RT

2009-10-12 Thread Roman Roelofsen
2009/10/12 Christophe Grand : > On Mon, Oct 12, 2009 at 12:00 PM, Roman Roelofsen > wrote: >> >> > Plus, if you use a shared loader for most interfaces, clojure instances >> > will >> > be able to share persistent data and closures. >> >> Nope, I tried this and it didn't work. The classloader exp

Re: Statics in clojure.lang.RT

2009-10-12 Thread Christophe Grand
On Mon, Oct 12, 2009 at 12:00 PM, Roman Roelofsen < roman.roelof...@googlemail.com> wrote: > > > Plus, if you use a shared loader for most interfaces, clojure instances > will > > be able to share persistent data and closures. > > Nope, I tried this and it didn't work. The classloader explicitly >

Re: Statics in clojure.lang.RT

2009-10-12 Thread Roman Roelofsen
> Plus, if you use a shared loader for most interfaces, clojure instances will > be able to share persistent data and closures. Nope, I tried this and it didn't work. The classloader explicitly complained that e.g. Var and RT have not been loaded by the same classloader :-/ --~--~-~--~--

Re: Statics in clojure.lang.RT

2009-10-12 Thread Christophe Grand
On Sun, Oct 11, 2009 at 8:25 PM, Manuel Woelker wrote: > > Hi, > > While hacking on counterclockwise I noticed that the clojure.lang code > uses a lot of static variables and methods. As far as I can tell this > makes it almost impossible to have two or more separate instances of > the clojure run

Re: Is there a standard function transforming a map's vals

2009-10-12 Thread Christophe Grand
Note that if you're only interested in using the resulting map as a function, (comp f map) works well (you can throw memoize in for good measure). On Sun, Oct 11, 2009 at 2:40 AM, samppi wrote: > > Is there a function in the standard libraries that's equivalent to > this: > > (defn transform-ma

Re: Proposal: New Reader Macro #s{ ... }

2009-10-12 Thread Danny Woods
Perl and Ruby do something similar with regular expressions, where the character following 'm' or 's' becomes the delimiter for that expression, making 'm/\/some\/path/' identical to 'm!/some/path!'. The delimeter can be 'smart' as well, where the closing delimiter is dependent upon the opening o