Re: How to use clojure-contrib library

2010-05-11 Thread Mat
Looking at the source in the master branch on Github, string.clj is present, but if I look into the 1.1.x branch, it's not. I will try to checkout the source from Github and compile it directly. Matteo On May 12, 7:51 am, Mat wrote: > Luc, > > I'm using the latest one, v1.1.0. I downloaded it >

Re: How to use clojure-contrib library

2010-05-11 Thread Mat
Luc, I'm using the latest one, v1.1.0. I downloaded it here: http://code.google.com/p/clojure-contrib/downloads/list I'm using the same version for clojure.jar. The strange thing is that when I inspect the content of the jar, there is no clojure/contrib/string, but only clojure/contrib/str_utils

Re: Beginner's question regarding implementing a constructor using gen-class

2010-05-11 Thread Gregg Williams
Okay...eleven days later and I've finally got something that works! You can find a fully working Clojure version of GraphEditor.java at http://gist.github.com/398198 Clojure beginners, there is a lot you can learn from comparing the Java and Clojure versions of this program (though Clojure progra

Re: How to visualise relations, bahavior and so on in functional programming ?

2010-05-11 Thread Armando Blancas
Booch, Rumbaugh and Jacobson took standard practices and tweaked them to the fashion of the mid '90's, tough they acknowledge only one another and their help in the UML User Guide. We can tweaking the UML away from its OOD bias as well as going to traditional techniques as simple as flowcharts, E-R

Re: How to use clojure-contrib library

2010-05-11 Thread Luc Préfontaine
Matteo, which version of clojure-contrib are you using ? The latest has the String class but an earlier version may not have it. To see the content: jar -tf clojure-contrib.jar You should see a string.clj in the list of components in the library and some string$xxx.class files. If not you are u

Re: How to use clojure-contrib library

2010-05-11 Thread patrik karlin
so i dont se clojure.contrib.string in the contrib the documentation is maybe lagin? 2010/5/11 Mat > > On May 11, 7:41 am, Mat wrote: > > Thank you very much, this time it worked perfectly. > > I knew it was very easy, but I could not figure it out not having all > > that java/shell experience.

Re: code review request: clojure.java.io

2010-05-11 Thread Peter Schuller
> Following symlinks in delete-file-recursively sounds like a recipe for > disaster to me. Sorry, I should have been more explicit. The (delete-file-recursively ...) in the patch *does* follow symlinks (implicitly, because isDirectory() returns true for symlinks pointing to diretories). The simpl

Re: How to use clojure-contrib library

2010-05-11 Thread Mat
On May 11, 7:41 am, Mat wrote: > Thank you very much, this time it worked perfectly. > I knew it was very easy, but I could not figure it out not having all > that java/shell experience. I'm sorry to bother you again with this silly question, but on the contrary of what I said I'm still not able

Re: code review request: clojure.java.io

2010-05-11 Thread Laurent PETIT
Hi Stuart, Nice piece of job ! I will nonetheless try to be constructive and give you some remarks I made to myself while reading the patch: * Shouldn't IOFactory protocol have a docstring to describe the possible options ? (So that it is possible to extend the protocol even further, e.g. when

Re: code review request: clojure.java.io

2010-05-11 Thread Michael Wood
On 11 May 2010 18:37, Peter Schuller wrote: >> Assembla Ticket #311 [1] calls for the promotion of clojure.contrib.io into >> clojure (as clojure.java.io). I have attached a patch, and am requesting >> comments and code review from the community. > > Should delete-file-recursively recurse down sym

Re: Serializable functions?

2010-05-11 Thread Michael Jaaka
Kevin and Phil nice work. Now if only object returned by fn had implemented Serializable and custom serialization functions which were doing: private void writeObject(ObjectOutputStream out) throws IOException { (with-out-str (print (pr-str this))) } private void read

Re: How to visualise relations, bahavior and so on in functional programming ?

2010-05-11 Thread Sean Devlin
Try LabVIEW On May 11, 2:33 pm, Donell Jones wrote: > Any examples ? > > On 11 Mai, 16:03, Rubén Béjar wrote: > > > > > And Data Flow Diagrams? > > I learnt about them while studying structured analysis > > and design at University, but I always thought they did > > not match very well with impe

Re: code review request: clojure.java.io

2010-05-11 Thread Peter Schuller
> Using an option for symlinks raises the possibility of using options to let > delete-file handle everything, e.g. > > (delete-file "foo" :recursive true) > > instead of > > (delete-file-recursively "foo") Yes. A potential argument for not conflating them might be that "delete-file" is a pretty s

Re: How to visualise relations, bahavior and so on in functional programming ?

2010-05-11 Thread Donell Jones
Any examples ? On 11 Mai, 16:03, Rubén Béjar wrote: > And Data Flow Diagrams? > I learnt about them while studying structured analysis > and design at University, but I always thought they did > not match very well with imperative programming... >     Rubén > Donell Jones escribió:Thanks for your

Re: Serializable functions?

2010-05-11 Thread Phil Hagelberg
On Tue, May 11, 2010 at 6:18 AM, Konrad Hinsen wrote: >> Right now I can imagine that implementation would look like this. Each >> function has it own raw input form (string which is parsed by clj >> reader). On serialization, that raw form would be serialized and >> received on the other unit. Wi

Re: Annoying auto-signature

2010-05-11 Thread Meikel Brandmeyer
Hi, On Tue, May 11, 2010 at 07:43:13PM +0200, Heinz N. Gies wrote: > >>> +1 (note them stacking up at the bottom?) > >> > >> Not if people have the courtesy to edit the text they are following up. > > And Mike is right, if people post usefully and don't do TOFU style > replies there won't be a

Re: Serializable functions?

2010-05-11 Thread Brian Hurt
Personally, I think this idea is a bad one, that will come back to bite people hard- but I doubt anyone is going to listen to me. If you serialize the code (either in lisp s-expression form, or java byte code), you can easily end up serializing most of the whole program. See, serialization isn't

Re: Calling apply on java methods

2010-05-11 Thread Michael Gardner
On May 11, 2010, at 12:39 PM, Alexandre Patry wrote: > I am trying to call a java method using apply, like : > > (apply .println [System/out "hello" "world"]) > > But I get an error: "Unable to resolve symbol: .println in this context" > > Am I missing something? Unfortunately, Java methods ar

Re: Cyclical refs fail on Clojure 1.2?

2010-05-11 Thread David McNeil
Peter- Thanks for the tip. I was aware of the stack overflow issue you described, but your comment motivated me to switch to using "mvn clojure:repl" instead of "mvn clojure:swank" to test the code, and this does appear to work (modulo the REPL printing issue). Thank you. -David McNeil -- You r

Re: Calling apply on java methods

2010-05-11 Thread Stuart Halloway
For now, the idiomatic way to do this is to use the shorthand anonymous form: (apply #(.println %) ... ) Of course the example of printing to System.out is fairly well covered with Clojure API fns anyway... Stu I am trying to call a java method using apply, like : (apply .printl

Re: Calling apply on java methods

2010-05-11 Thread Alexandre Patry
Le 2010-05-11 13:45, Heinz N. Gies a écrit : On May 11, 2010, at 19:39 , Alexandre Patry wrote: I am trying to call a java method using apply, like : (apply .println [System/out "hello" "world"]) But I get an error: "Unable to resolve symbol: .println in this context" Am I missing someth

Re: code review request: clojure.java.io

2010-05-11 Thread Stuart Halloway
Yes, that is right. "git apply" or "git am" should work. Stu Stuart, I think it's a great idea to ask the community for input. I'm new to working with Assembla (and still a little new to working with git and github.) So, if I pull down the master branch of Clojure from http://github.com/richh

Re: code review request: clojure.java.io

2010-05-11 Thread Michael Harrison (goodmike)
Stuart, I think it's a great idea to ask the community for input. I'm new to working with Assembla (and still a little new to working with git and github.) So, if I pull down the master branch of Clojure from http://github.com/richhickey/clojure and apply the patch file I find on Assembla, I'll h

Re: Calling apply on java methods

2010-05-11 Thread Heinz N. Gies
On May 11, 2010, at 19:39 , Alexandre Patry wrote: > I am trying to call a java method using apply, like : > > (apply .println [System/out "hello" "world"]) > > But I get an error: "Unable to resolve symbol: .println in this context" > > Am I missing something? Apply only works on clojure met

Re: Annoying auto-signature

2010-05-11 Thread Heinz N. Gies
On May 11, 2010, at 19:05 , Marc Spitzer wrote: > it is annoying +1 > > marc > > On Tue, May 11, 2010 at 12:55 PM, Mike Meyer > wrote: >> [format recovered from top postgin.] >> > On May 7, 2:13 am, Mibu wrote: > Am I the only one driven mad by the new auto-appended signature to

Re: code review request: clojure.java.io

2010-05-11 Thread Stuart Halloway
Using an option for symlinks raises the possibility of using options to let delete-file handle everything, e.g. (delete-file "foo" :recursive true) instead of (delete-file-recursively "foo") Stu Assembla Ticket #311 [1] calls for the promotion of clojure.contrib.io into clojure (as clojur

Calling apply on java methods

2010-05-11 Thread Alexandre Patry
I am trying to call a java method using apply, like : (apply .println [System/out "hello" "world"]) But I get an error: "Unable to resolve symbol: .println in this context" Am I missing something? Thanks, Alex -- You received this message because you are subscribed to the Google Groups "Cloj

Re: Cyclical refs fail on Clojure 1.2?

2010-05-11 Thread Peter Schuller
> (def a (ref ())) > > (def b (ref ())) > > (dosync >  (alter a conj b)) > > (dosync >  (alter b conj a)) > > This last expression fails with an "Evalutation aborted" message on > Clojure 1.2.0-master-SNAPSHOT (it works on Clojure 1.1.0). Maybe I am > not using refs correctly, but I did not expect

Re: Annoying auto-signature

2010-05-11 Thread Marc Spitzer
it is annoying +1 marc On Tue, May 11, 2010 at 12:55 PM, Mike Meyer wrote: > [format recovered from top postgin.] > >> > > On May 7, 2:13 am, Mibu wrote: >> > > Am I the only one driven mad by the new auto-appended signature to >> > > every message in this group ("You received this message beca

Re: How to visualise relations, bahavior and so on in functional programming ?

2010-05-11 Thread Rubén Béjar
And Data Flow Diagrams? I learnt about them while studying structured analysis and design at University, but I always thought they did not match very well with imperative programming...     Rubén Donell Jones escribió: Thanks for your reply. I think flowchart make sense but I can´t imag

Re: Using swank-clojure with clojure-1.2.0-master-SNAPSHOT

2010-05-11 Thread nipra
Hi, On May 9, 7:15 pm, Benjamin Teuber wrote: > Hi nipra, > > and which swank-clojure do you use on the emacs side? I guess not the > one from ELPA, right? I've not made any changes on the emacs side. I'm using swank-clojure from ELPA. Regards, nipra -- You received this message because you a

Re: Serializable functions?

2010-05-11 Thread verd
Hi Michael, Some time ago I came along Harbor: a server which can serialize Java objects (and classes) over the wire See http://coolharbor.100free.com/index.htm Not open source but free. Hope you get some inspiration. verd On 11 mayo, 11:42, Michael Jaaka wrote: > Hi, > > Since in Clojure 1.2

Cyclical refs fail on Clojure 1.2?

2010-05-11 Thread David McNeil
(def a (ref ())) (def b (ref ())) (dosync (alter a conj b)) (dosync (alter b conj a)) This last expression fails with an "Evalutation aborted" message on Clojure 1.2.0-master-SNAPSHOT (it works on Clojure 1.1.0). Maybe I am not using refs correctly, but I did not expect this to fail. Can anyo

Re: Annoying auto-signature

2010-05-11 Thread Mike Meyer
[format recovered from top postgin.] > > > On May 7, 2:13 am, Mibu wrote: > > > Am I the only one driven mad by the new auto-appended signature to > > > every message in this group ("You received this message because you > > > are subscribed...")? It started on April 16th. Is there a way a > > >

Re: code review request: clojure.java.io

2010-05-11 Thread Peter Schuller
> Assembla Ticket #311 [1] calls for the promotion of clojure.contrib.io into > clojure (as clojure.java.io). I have attached a patch, and am requesting > comments and code review from the community. Should delete-file-recursively recurse down symlinks (on platforms that support them)? An admitted

code review request: clojure.java.io

2010-05-11 Thread Stuart Halloway
Assembla Ticket #311 [1] calls for the promotion of clojure.contrib.io into clojure (as clojure.java.io). I have attached a patch, and am requesting comments and code review from the community. Reasons you want to take time from your day to read this code: (1) It's important. This isn't just

Re: Annoying auto-signature

2010-05-11 Thread Brandon Mason
+1 (note them stacking up at the bottom?) On May 9, 10:04 pm, ka wrote: > +1 > > On May 7, 2:13 am, Mibu wrote: > > > Am I the only one driven mad by the new auto-appended signature to > > every message in this group ("You received this message because you > > are subscribed...")? It started on

Re: Serializable functions?

2010-05-11 Thread Kevin Downey
http://github.com/technomancy/serializable-fn/ On Tue, May 11, 2010 at 6:18 AM, Konrad Hinsen wrote: > On 11.05.2010, at 13:07, Michael Jaaka wrote: > >> Right now I can imagine that implementation would look like this. Each >> function has it own raw input form (string which is parsed by clj >>

Re: How to use clojure-contrib library

2010-05-11 Thread Luc Préfontaine
Oups, I stopped using windows for so long that I forgot about the semi-colon thing :))) That frees a lot of memory for other stuff... Luc On Tue, 2010-05-11 at 08:38 +0200, Michael Wood wrote: > On 11 May 2010 03:30, Luc Préfontaine wrote: > > > > Hi, > > > > The trick is to get contrib on the

Re: How to visualise relations, bahavior and so on in functional programming ?

2010-05-11 Thread Sean Devlin
Autodoc is the only thing that's remotely standard. Clojure is just a toddler, after all :) Sean On May 11, 10:08 am, Donell Jones wrote: > So there is no standard for it, right ? People do what they know > best ? > > On 11 Mai, 16:04, Sean Devlin wrote: > > > > > Put the homoiconic nature of

Re: How to visualise relations, bahavior and so on in functional programming ?

2010-05-11 Thread Donell Jones
So there is no standard for it, right ? People do what they know best ? On 11 Mai, 16:04, Sean Devlin wrote: > Put the homoiconic nature of Clojure to work.  Make a variation of > clojure.inspect and use it to create charts of program flow, or tweak > your own version of autodoc.  Take full advan

Re: How to visualise relations, bahavior and so on in functional programming ?

2010-05-11 Thread Sean Devlin
Put the homoiconic nature of Clojure to work. Make a variation of clojure.inspect and use it to create charts of program flow, or tweak your own version of autodoc. Take full advantage of metadata. There's a ton of long hanging fruit here if you just go looking for it. My $.02 Sean On May 11,

Re: How to visualise relations, bahavior and so on in functional programming ?

2010-05-11 Thread Donell Jones
Thanks for your reply. I think flowchart make sense but I can´t imagine how a big project can be visualised with that (???). I think no manager in the world would make a big project without a good documentation ... nah I know there are some :) On 11 Mai, 15:01, Jarkko Oranen wrote: > On May 11,

Re: Serializable functions?

2010-05-11 Thread Konrad Hinsen
On 11.05.2010, at 13:07, Michael Jaaka wrote: > Right now I can imagine that implementation would look like this. Each > function has it own raw input form (string which is parsed by clj > reader). On serialization, that raw form would be serialized and > received on the other unit. With first cal

Re: How to visualise relations, bahavior and so on in functional programming ?

2010-05-11 Thread Jarkko Oranen
On May 11, 11:18 am, Donell Jones wrote: > Hi Team, > I am really interested in functional programming. But I am asking > myself, what if the project get bigger, like the software Runa realise > with Clojure. In OOP we got diagrams like UML to visualise this. But > what can we do in FP ? Are there

How to visualise relations, bahavior and so on in functional programming ?

2010-05-11 Thread Donell Jones
Hi Team, I am really interested in functional programming. But I am asking myself, what if the project get bigger, like the software Runa realise with Clojure. In OOP we got diagrams like UML to visualise this. But what can we do in FP ? Are there any diagrams that can be used to explain things ?

Re: How to use clojure-contrib library

2010-05-11 Thread Mat
Thank you very much, this time it worked perfectly. I knew it was very easy, but I could not figure it out not having all that java/shell experience. At one point I also tried something like this, with the colon, but it did not work, so probably I mistook the order or something. Thank you. Matteo

Re: Easier way to run Clojure from command line?

2010-05-11 Thread Kasim
Hi Jason, I created a project called ClojureW (http://bitbucket.org/kasim/ clojurew/src/ )that I believe exactly provides what you are looking for. It is just a simple launch script. You can run it via command line without any set up. If you have Clojure installed already, you can just set CLOJURE

Re: How to use clojure-contrib library

2010-05-11 Thread patrik karlin
you should learn how the java class paths works but take a look At http://github.com/technomancy/leiningen i wish i would how found that earlier. 2010/5/10 Mat > Hi all, > I am totally new to clojure and this is a very simple question, but I > spent the last two hours trying to figure this out

Re: Serializable functions?

2010-05-11 Thread Michael Jaaka
Well, this is obvious, but I would like to eliminate AOT and distribution between units. This would give advantage over non- functional languages like C++/Java since functions in Clojure should be treated just like any other value. Currently they are handicapped. Right now I can imagine that imple

Re: autoloading code at repl startup

2010-05-11 Thread Lauri Pesonen
On 11 May 2010 10:55, Tassilo Horn wrote: > I think ~/.clojure/user.clj is evaluated on each clojure startup, so you > could add that code there. At least in my setup ~/.clojure/user.clj does not get loaded unless ~/.clojure is in the JVM classpath. > Tassilo -- ! Lauri -- You received thi

Re: Serializable functions?

2010-05-11 Thread Konrad Hinsen
On 11.05.2010, at 11:42, Michael Jaaka wrote: > Since in Clojure 1.2 all data structures are serializable and Clojure > is homoiconicity language. Why don't make functions serializable? I'm > trying to pass function with RMI and execute in on the second REPL. I didn't try this myself yet, but my

Re: autoloading code at repl startup

2010-05-11 Thread Tassilo Horn
On Tuesday 11 May 2010 10:43:00 Lauri Pesonen wrote: > How do people autoload code in their repl at startup? > [...] > > I know I can use user.clj on my classpath to do this, but then I need > to copy that file to each clojure project that I have. I think ~/.clojure/user.clj is evaluated on each

Serializable functions?

2010-05-11 Thread Michael Jaaka
Hi, Since in Clojure 1.2 all data structures are serializable and Clojure is homoiconicity language. Why don't make functions serializable? I'm trying to pass function with RMI and execute in on the second REPL. Right now, the only way to get it working is to pass string and evaluate it on REPL. H

autoloading code at repl startup

2010-05-11 Thread Lauri Pesonen
Hi all, How do people autoload code in their repl at startup? I'd like to specify code that would be loaded into each repl that I start with slime. E.g. (use 'clojure.contrib.repl-utils) and (set! *warn-on-reflection* true). Not being able to do this easily means that I don't use e.g. the repl-uti