Re: ANN: textmate-clojure, SLIME for TextMate (sorta)

2010-09-28 Thread lpetit
Awesome ! On Sep 24, 4:39 am, David Nolen wrote: > First off Acknowledgements: > > Aria Haghighi, did much of the heavy lifting on this project! > Stephen Roller, created the first version of the bundle in 2008 > Mark McGranaghan, expanded Stephen Roller's version > Justin Balthrop & Lance Brad

Re: Question about future

2009-12-09 Thread lpetit
Please also note the existence of (future-call), which takes a no-arg fn instead of a body, HTH, -- Laurent On 25 nov, 17:21, David Brown wrote: > On Tue, Nov 24, 2009 at 09:04:38PM -0800, Hong Jiang wrote: > >Hi all, > > >I'm new to Clojure and playing with small programs. Today I wrote a > >s

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: The Path to 1.0

2009-04-26 Thread lpetit
On 26 avr, 15:04, Rich Hickey wrote: > On Apr 24, 1:57 pm, Howard Lewis Ship wrote: > > > Another option is for the version number to be in build.xml, and for > > it to generate a runtime file (so that Clojure can know its own > > version number) and set the version number inside a generated p

Re: Calling Clojure from Java (again)

2009-01-23 Thread lpetit
On 23 jan, 03:00, Stuart Sierra wrote: > On Jan 22, 6:51 pm, Peter Wolf wrote: > > > However, if there is only one Clojure image used for references and the > > like, what happens if someone calls an infinite loop, or infinite > > recursion, in a file.  Does the Clojure server hang/blow up?   >

Re: Calling Clojure from Java (again)

2009-01-23 Thread lpetit
Hi, On 23 jan, 01:43, Peter Wolf wrote: > Hi Laurent, > 1) Does Eclipse use the server for resolving references? Currently, the only resolved references are those that come from a clojure environment launched by the user. So yes. When time comes to resolve references for the needs of the editor

Re: A nil puzzle

2009-01-23 Thread lpetit
+1. #{} is the empty set, () is the empty list, {} is the empty map. Cheers, -- Laurent On 23 jan, 10:17, Konrad Hinsen wrote: > On 23.01.2009, at 09:35, Mark Engelberg wrote: > > > Now, here's the puzzle.  Let's say you want to convert this idea over > > to working with lists, or perhaps seq

Re: Any way we can get this in clojure-contrib?

2009-01-23 Thread lpetit
Interesting. Are u sure joda-time is so widely in usage among java developers ? Anyway, as far as I remember, one of the benefits of clojure running on an existing VM (the JVM) is to leverage all the existing APIs. Since the date/time support would be in clojure-contrib (and not clojure-core), c

Re: Calling Clojure from Java (again)

2009-01-22 Thread lpetit
I'll also reply inline ... -> On 23 jan, 00:51, Peter Wolf wrote: > Thanks for the lengthy reply Laurent,  Replies in-line > > lpetit wrote: > > Peter, > > > We asked us the same question some weeks ago, on clojuredev. > > > We took the path to follo

Re: File, Line Number and Usage Info

2009-01-22 Thread lpetit
Peter, A weird thing seems to happen often those days, and I have remarked it's related to you. You start a new post, but it appears to be in the continuation of a previous one, with the subject changed. This does not look good to me. Are you doing something like this to start a new post : "ope

Re: Calling Clojure from Java (again)

2009-01-22 Thread lpetit
Peter, We asked us the same question some weeks ago, on clojuredev. We took the path to follow how eclipse launches a java application when the user requires it to test it. So we created a customized "launch configuration" (sorry, eclipse jargon), that is just a classical eclipse java launcher w

Re: File, Line Number and Usage Info

2009-01-22 Thread lpetit
Hello, Here is how I get an hierarchical data structure of information on ns in clojure-dev : The tree has really just 3 levels : one root node representing all ns, one child node of the root node representing one ns each, one child node per ns node for ns interned symbols. Each node is represen

Re: Basic about setting upp Clojure and editor enviroment

2009-01-21 Thread lpetit
es > up broken in the about plugins and there is no function ality to be found. > > Tom > > 2009/1/21 lpetit > > > > > Hello, > > > If you want to give a "try" to clojure-dev (but you may well end up > > using it if you can afford all its current

Re: Basic about setting upp Clojure and editor enviroment

2009-01-21 Thread lpetit
Hello, If you want to give a "try" to clojure-dev (but you may well end up using it if you can afford all its current limitations :-), I'll recommand these two links : - documentation page : the first lines explain how to install it (as easy as installing any eclipse plugin from an eclipse updat

Re: Clojure Library Documentation

2009-01-20 Thread lpetit
Hello, As modest as this could be in the quest of a formal categorization, I find the integrated string pattern search integrated into clojuredev really useful, so I can't resist to do this shameless plug. You can see it in action, with a search on the word "string", either by searching the word

Re: Yet another html templating library

2009-01-19 Thread lpetit
Ok, thanks for the precision. It's always very bad when I make false comparisons .. very difficult to get rid of them. Merci Christophe, A bientôt, -- Laurent On 19 jan, 13:53, Christophe Grand wrote: > lpetit a écrit :> Hello, > > > Is it somehow related to the way Wi

Re: Yet another html templating library

2009-01-19 Thread lpetit
Hello, Is it somehow related to the way Wicket does templating ? On Jan 19, 11:34 am, Christophe Grand wrote: > Hello group! > > Enlive (http://github.com/cgrand/enlive/tree/master) is a selector based > templating library. > The main design goal was to decouple html and presentation code, tha

clojure eclipse plugin status (clojuredev)

2009-01-18 Thread lpetit
Hello, Just a brief message to let you know the status of clojure-dev. It's still in its infancy, but already usable to eclipse user that currently have nothing but a shell to work with. Please see the screenshots : http://code.google.com/p/clojure-dev/wiki/ScreenShots And also consult the do

Re: Clojure-dev Eclipse Wizard issues

2009-01-18 Thread lpetit
x27;t the place to upload > files (in the files section of the Clojure mailing list), then I won't > post any other clojuredev-related files outside of clojuredev-users . > I just think it is a little more convenient to have the whole > discussion on one mailing list. > >

Re: Calling a mapreduce job from inside another

2009-01-18 Thread lpetit
And please reply ;-) On Jan 18, 7:12 pm, "Stephen C. Gilardi" wrote: > On Jan 18, 2009, at 12:48 PM, aimhier wrote: > > > Is it possible to call a map-reduce job from inside another. If yes > > how. > > > Also is it possible to disable the reducer completely, i.e I wish to > > stop immediately a

Re: Clojure-dev Eclipse Wizard issues

2009-01-18 Thread lpetit
Hello, Welcome, second external user of clojure-dev ! :-). You will find clojure-dev developers in this mailing list. And, if others think the discussions become too clojure-dev centric, we can still continue this on the user group for clojure-dev. First of all, let me say there's an update sit

Re: Common backend project?

2009-01-17 Thread lpetit
On Jan 17, 10:05 pm, Meikel Brandmeyer wrote: > Salut Laurent, > > Am 17.01.2009 um 21:40 schrieb lpetit: > > > Now that's interesting. It may be easier to share code because you too > > decided to not follow slime/swank which, I guess, imposes as a middle > >

Re: Common backend project?

2009-01-17 Thread lpetit
Now that's interesting. It may be easier to share code because you too decided to not follow slime/swank which, I guess, imposes as a middle language something closer to emacs-lisp than to clojure for the exchanged data structures. And we could indeed also share the whole code of the server side.

Re: Common backend project?

2009-01-17 Thread lpetit
On Jan 17, 7:47 pm, Peter Wolf wrote: > Sure, good idea.  I'm in! > > As a first cut, I think we need to separate those tools written in JVM > languages (Clojure/Java) and those written in something else. > > I certainly think the JVM based projects can, and should, share > components.   For sur

Re: Common backend project?

2009-01-17 Thread lpetit
I downloaded cusp source code and digged into it a little bit once. The problem is, I couldn't figure out quickly the detail of the swank client they implemented, nor did I figure out quickly the detail of the interface between slime and swank. I wished there were already a client for swank writ

Re: How to implement "go to definition" and "find all references"

2009-01-17 Thread lpetit
Hello Peter, As I understand, you've made what I also began to make for clojuredev (clojure dev environment for eclipse me and other folks are working on on our spare time) : a static source code parser. Mine is currently not very tested (and maybe not very usefull as is, because it has not yet b

Re: How to implement "go to definition" and "find all references"

2009-01-16 Thread lpetit
Hello, While I understand this solution has been long in place for Lips, I don't think it looks like the ideal solution, e.g. in a world where the "source code" is still in files, and not managed by the "lisp image". I'm aware of just smalltalk that does this cleanly (it is even managing versions

Re: configurable bash script to launch Clojure available

2009-01-16 Thread lpetit
On Jan 16, 9:06 am, Timothy Pratley wrote: > +1 (and a windows .bat file for the unwashed) + 1 too. > I strongly suggest that the script name needs to be retained in > *command-line-args*. > ie: clj myscript.clj 1 2 No, please don't, or it would not be coherent with the way java handles it. M

Re: Observing namespace changes

2009-01-14 Thread lpetit
OK thank you both Chris & Mike for your answer. What I've done for the moment is similar to what Mike did: at any place where there is a chance for something to change namespaces, I reload a new snapshot (and I throw the old). Registering watchers for Vars seems very interesting, I'll investigat

Observing namespace changes

2009-01-14 Thread lpetit
Hello, Is it possible for my code to "subscribe" to events of type "namespace change" which would inform of deltas on top level namespaces : - added symbol - removed symbol - changed root var binding of a symbol Indeed, I'm currently implementing a little "namespace browser" View for clojuredev

Re: SLIME: trouble with java.lang.OutOfMemoryError

2009-01-11 Thread lpetit
Hello, If you like eclipse and would like to see where clojuredev (eclipse plugin) is right now, you can give a quick look at the current state of clojuredev by trying to immediately install it via the update site link : http://clojure-dev.googlecode.com/svn/updatesite/ Still not ready for publ

Re: (compile) also loads the lib ?

2009-01-09 Thread lpetit
on the files he modifies. > > -Stuart Sierra > > On Jan 9, 2:00 am, lpetit wrote: > > > On 9 jan, 07:54, lpetit wrote: > > > > On 9 jan, 04:03, Stuart Sierra wrote: > > > > > Later on, if I call (load) (from a fresh clojure environment

Re: (compile) also loads the lib ?

2009-01-09 Thread lpetit
On 9 jan, 17:00, Rich Hickey wrote: > Your initial presumption is not correct. All top-level expressions are > compiled and will be evaluated on load. It is true that compilation > supports a same-world model, and evaluates the file while compiling > (in order to ensure declarations and macro def

Re: (compile) also loads the lib ?

2009-01-08 Thread lpetit
On 9 jan, 07:54, lpetit wrote: > On 9 jan, 04:03, Stuart Sierra wrote: > > > Later on, if I call (load) (from a fresh clojure environment) from the > > > compiled classes, the top level (println)s are not executed, since not > > > compiled. > > > Yes, t

Re: (compile) also loads the lib ?

2009-01-08 Thread lpetit
On 9 jan, 04:03, Stuart Sierra wrote: > On Jan 8, 7:28 pm, lpetit wrote: > > > It seems that (compile) generates .class files as expected, and also > > loads the lib in the environment as well. > > > Is it a (apparently undocument) feature ? Or a bug ? > &

(compile) also loads the lib ?

2009-01-08 Thread lpetit
Hello, It seems that (compile) generates .class files as expected, and also loads the lib in the environment as well. Is it a (apparently undocument) feature ? Or a bug ? And also, it seems that (compile) does not load the lib from the compiled classes, but from the source files. I guess that,

loading namespace from AOT compiled files vs source files

2009-01-08 Thread lpetit
Hello, There is a difference in using (require) on a namespace if it was compiled via (compile) or if it uses plain clj source files. The difference appears if in the source file, you have for example top level (println) commands. If you (require) the namespace from compiled classes, you will n

Re: Using java.ext.dirs to manage the Classpath for Clojure REPLs

2009-01-04 Thread lpetit
Note that since JDK 1.6, it is possible to use the * wildcard in classpath items to embed all the jars in a directory at once. So with proper use of links in a "root" directory containing a bunch of jars, it's possible to shorten the classpath to DIR/*:classes:src BTW, java.ext.dirs' semantics i

Re: literate snake

2009-01-02 Thread lpetit
Hello, here are some feedbacks : I suggest you should create a namespace for the code of the game ('cause you want to show clojure good coding practices, as well as good coding conventions, won't you ;-) Could it make sense to use even fewer def's than currently ? I guess it could be made not m

Re: literate snake

2009-01-02 Thread lpetit
Yes, what you did should certainly be called "Intentional programming" (or "Intention revealing programming") instead of "literate programming". This style of programming is for example encouraged by the book "Clean Code" of Robert C. Martin. I like this style of programming, I too think it is c

Re: What is this function called?

2009-01-02 Thread lpetit
I don't know if the function exists on its own in Common Lisp, but in Common Lisp there is maplist that does what you get by combining map and rests : http://www.lispworks.com/documentation/HyperSpec/Body/f_mapc_.htm HTH, -- Laurent On Jan 2, 7:21 pm, "Andrew Baine" wrote: > On Fri, Jan 2, 200

Re: swank-clojure license

2008-12-31 Thread lpetit
OOps, I'm losing memory, I answered twice to the e-mail ;-) On 31 déc, 11:16, lpetit wrote: > Yes, this is what I remember from LGPL. But anyway, swank-clojure is > not LGPL, it's GPL. > > I re-read my original post, and it seems clear to me : I stated I wish > to embed

Re: swank-clojure license

2008-12-31 Thread lpetit
n advance to anybody that will demonstrate it's feasible or it's not feasible, -- Laurent On 30 déc, 23:55, "Mark H." wrote: > On Dec 30, 10:26 am, Phil Hagelberg wrote: > > > lpetit writes: > > > I'm not sure. From what I remember, what you describe is more

Re: swank-clojure license

2008-12-30 Thread lpetit
On 30 déc, 23:55, "Mark H." wrote: > On Dec 30, 10:26 am, Phil Hagelberg wrote: > Actually the LGPL allows linking to the library (somewhat different > than "using the code") from any program, even one which is not under > an open-source license.  "L" used to stand for "library" and the > canoni

Re: swank-clojure license

2008-12-30 Thread lpetit
I'm not sure. From what I remember, what you describe is more related to LGPL ? On 30 déc, 18:19, Phil Hagelberg wrote: > lpetit writes: > > So I guess that if for clojure-dev (eclipse plugin for clojure) we > > want to use it for interactivity with an external clojure

swank-clojure license

2008-12-30 Thread lpetit
Sorry for this e-mail that could be more targeted to Jeffrey Chu, but I was unable to find its direct e-mail address, and I know he is a clojure ml member, so ... It seems that swank-clojure license is a flavor of GPL ("License as distributed with Emacs"). So I guess that if for clojure-dev (ecl

Re: making code readable

2008-12-29 Thread lpetit
You should consider using docstrings for documenting functions On 29 déc, 16:45, "Mark Volkmann" wrote: > On Mon, Dec 29, 2008 at 5:44 AM, Mark Volkmann > > > > wrote: > > I would like to produce a version of the snake code that could serve > > as an example of the kind of code that the Clojure

Re: Exercise: words frequency ranking

2008-12-26 Thread lpetit
+ %1 {%2 1}) {}) sort (partial sort-by (comp - val))] (-> str words freqs sort))) HTH, -- Laurent On Dec 26, 4:37 pm, lpetit wrote: > Instead of #(- (val %)), one could also use the compose function : > (comp - val) > > My 0,02 EURO, > > -- > Lauren

Re: Exercise: words frequency ranking

2008-12-26 Thread lpetit
Instead of #(- (val %)), one could also use the compose function : (comp - val) My 0,02 EURO, -- Laurent On Dec 25, 4:58 pm, Mibu wrote: > My version: > > (defn top-words [input-filename result-filename] > (spit result-filename > (apply str >(map #(format "%s : %d\n"

Re: December monads

2008-12-23 Thread lpetit
On 22 déc, 08:51, Konrad Hinsen wrote: > [ ... ] In the long run, we should have a monad tutorial for   > Clojure, rather then let everyone learn Haskell first. +1 on this ! > > Konrad. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Exercise: how to print multiplication table?

2008-12-22 Thread lpetit
Hello, Not a lot of time to answer, so I'll be straight to the point below : On 22 déc, 16:23, Piotr 'Qertoip' Włodarek wrote: > Hello, > > Being new to Clojure, to Lisp and to functional programming in > general, I have some trouble wraping my head around it. > > As the first exercice, I would

Re: code golf

2008-12-18 Thread lpetit
Hello, On Dec 18, 5:49 am, Chouser wrote: > Which leads me to this, though it fails for reasons that escape me: > (defn enc[s e](apply str(map`{~@(take-nth 2 e)}s))) This one maybe fails because ~@ is a reader form that needs to expand at compile time. So if at compile time, e is not known (e.g

Re: FAQ

2008-12-17 Thread lpetit
Hello, > * Is there an IDE for Clojure? > > Answer: There are plug-ins for Eclipse clojure-dev/> and NetBeans .  There's also > Emacs. Sincerely, clojure-dev (Eclipse plugin) is still currently in infancy. I think it's not fair for the emacs ver

Re: Is clojure.core/require documentation out of date ?

2008-12-16 Thread lpetit
OK, thank you for the link. I know don't feel comfortable with the notion of lib. I currently assume that it is more or less similar to a namespace : it looks like a namespace, it tastes like a namespace, but still does seem to be not considered a namespace. In which ways does the notion of "lib

Is clojure.core/require documentation out of date ?

2008-12-16 Thread lpetit
Hello, I try to fill the gap from when I discovered clojure several months ago, and I'm trying to understand the lib vs namespace stuff. I go straight to what I consider may be the primary source of documentation by calling (doc require), and I see this : " 'require loads a lib by loading its

Re: Is 'mapcat' name that logic ?

2008-12-13 Thread lpetit
On 13 déc, 17:03, Michel Salim wrote: > On Dec 13, 8:28 am, lpetit wrote:> Hello, > > > I wanted to know if I was alone thinking that 'mapcat' should better > > have been named 'catmap' ? > > When reading code, this looks more natural because it re

Is 'mapcat' name that logic ?

2008-12-13 Thread lpetit
Hello, I wanted to know if I was alone thinking that 'mapcat' should better have been named 'catmap' ? When reading code, this looks more natural because it resembles the functional composition of the 2 functions : (cat (map ...)) I know this is an inheritence from older lisp dialects, but cloju

Re: Functional programming newbie question

2008-12-13 Thread lpetit
Yes, the semantics of a sequence force it to be immutable : "Seqs differ from iterators in that they are persistent and immutable" ( http://clojure.org/sequences ) So there's simply no need to have a copy function for sequences (or for any other clojure data structure). HTH, -- Laurent On 13

Re: fix imports

2008-11-28 Thread lpetit
Hello, This is certainly possible, I think. The "fix import" action could try to resolve an unknown symbol by first searching the symbol in one of the classpath available namespaces, and then search for java classes in the classpath. It could then add an import/require command for each found reso

Re: trampoline for mutual recursion

2008-11-27 Thread lpetit
On 27 nov, 18:09, Rich Hickey <[EMAIL PROTECTED]> wrote: > > > (defn trampoline [f] > > >   (let [ret (f)] > > >      (cond f > > >        (fn? ret) (recur ret) > > >        (instance? org.clojure.lang.NoBoingWrapper f) (.returnInstance > > > f) > > >        else ret))) > I considered that, and it

Re: trampoline for mutual recursion

2008-11-27 Thread lpetit
On Nov 27, 1:58 pm, lpetit <[EMAIL PROTECTED]> wrote: > and the modification of trampoline along these lines : > (defn trampoline [f] >   (let [ret (f)] >      (cond f >        (fn? ret) (recur ret) >        (instance? org.clojure.lang.NoBoingWrapper f) (.returnInstanc

Re: trampoline for mutual recursion

2008-11-27 Thread lpetit
f) (.returnInstance f) else ret))) HTH, -- Laurent On Nov 26, 10:38 pm, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > On Nov 26, 2008, at 4:32 PM, lpetit wrote: > > > I've maybe missed something, but will this work if one wants to make > > the fi

Re: Clojure Eclipse plugin progress (clojure-dev)

2008-11-26 Thread lpetit
Hello, In order to help a poor javaish like me go straight to the point with what emacs offers concerning what you say below (sexpr ...), what would you consider the best link to follow and read to understand the functionalities, and have the keyboard shortcuts. Indeed, I intend to (humbly) do s

Re: trampoline for mutual recursion

2008-11-26 Thread lpetit
On 25 nov, 15:05, Rich Hickey <[EMAIL PROTECTED]> wrote: > To convert to a trampoline, simply return closures over your tail > calls, rather than direct calls. This is as simple as prepending # I've maybe missed something, but will this work if one wants to make the final return value of the tai

Re: Eclipse Plugin- any plans for this?

2008-11-22 Thread lpetit
On Nov 22, 7:38 pm, "J. McConnell" <[EMAIL PROTECTED]> wrote: > On Sat, Nov 22, 2008 at 1:22 PM, lpetit <[EMAIL PROTECTED]> wrote: > > > I thought about making an eclipse update site available for the current > > state of the plugin. But for the moment

Re: French translation of the Clojure rationale

2008-11-22 Thread lpetit
Well, why not speak french in a newsgroup, to change a little from the usual routine :-) Je veux bien relire, mais comme j'arrive un peu après la bataille, si tu as déjà refait une nouvelle version du document, je préfèrerai, tant qu'à faire, repartir de cela. Je pense avoir déjà vu plusieurs end

Re: Eclipse Plugin- any plans for this?

2008-11-22 Thread lpetit
lling the plugin via svn source ? -- Laurent > > On Nov 22, 8:53 am, lpetit <[EMAIL PROTECTED]> wrote: > > > Well, I'm also on board on the clojuredev team since yesterday, > > > Take a look at the roadmap list (which currently is more a feature > > wish

Re: Eclipse Plugin- any plans for this?

2008-11-22 Thread lpetit
Well, I'm also on board on the clojuredev team since yesterday, Take a look at the roadmap list (which currently is more a feature wishlist than a prioritized list), and please help completing it, and give us feedback on what you think your priorities would be, -- Laurent On Nov 21, 5:25 pm, ve

Re: (source name)

2008-11-03 Thread lpetit
And this could open the door to "organic code" : dynamically discovering the source code of functions, and - why not- correcting / adjusting the code by re-def ining the function by manipulating its original source code. Some sort of macro, at runtime :-) On Nov 3, 3:57 pm, Paul Barry <[EMAIL PR

Re: offtopic - where are you come from? (poll)

2008-10-20 Thread lpetit
Laurent PETIT, Bron (near Lyon), France On Oct 20, 7:03 pm, Luc Prefontaine <[EMAIL PROTECTED]> wrote: > Montreal prov. of Québec in Canada > > Luc Préfontaine > > On Fri, 2008-10-17 at 11:53 +0200, Mikael Hall wrote: > > I'm from sweden. > > > Mikael Hall > > > 2008/10/17 Rastislav Kassak <[EMAI