Re: best way to make use of association lists

2009-09-08 Thread kyle smith
Why not just use http://clojure.org/api#sorted-map ? --~--~-~--~~~---~--~~ 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

Re: best way to make use of association lists

2009-09-08 Thread Richard Newman
Why not just use http://clojure.org/api#sorted-map ? Because an association list keeps insertion order, whilst a sorted-map keeps sorted order. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To

Re: minor grievance with arithmetic on characters

2009-09-08 Thread Timothy Pratley
According to the docstring compare returns -1, 0 or 1: user= (compare \b \g) -5 Regards, Tim. On Sep 8, 2:02 pm, Adrian Cuthbertson adrian.cuthbert...@gmail.com wrote: Clojure's compare; (compare \a \b) -1 user= (doc compare) - clojure.core/compare ([x y])  

Re: Clojure quickstart maven archetype

2009-09-08 Thread Scott Fleckenstein
Thanks Stuart, Just an FYI, I added repl support to the clojure-maven-plugin here: http://github.com/nullstyle/clojure-maven-plugin/tree/master Rather than taking clojureshell's approach, I start a separate process similar to how the rest of the plugin works. In fact, I just needed to

Re: clojure-mode survey

2009-09-08 Thread Konrad Hinsen
On 8 Sep 2009, at 02:36, Phil Hagelberg wrote: However, now that clojure-mode has the M-x clojure-install command that sets up SLIME etc, I don't know if the built-in subprocess features are worth keeping around any more. Personally I have never used them or heard of anyone using them;

Re: dynamic :use

2009-09-08 Thread Chris Kent
James Sofra james.sofra at gmail.com writes: I know that this has come up before on the group and but is this not essentially dependency injection where the dependency being injected is a name space that presumably follows a particular convention in terms of what functions it provides?

refer from inside of ns macro?

2009-09-08 Thread tmountain
Is it possible to refer from inside of the ns macro rather than doing it after the fact? I've browsed the docs and don't see an obvious way to do this. Right now I'm doing something like the following. (ns foo (:require [bar])) (refer 'bar) -Travis

Re: Looping idiom

2009-09-08 Thread songoku
On Sep 8, 5:39 am, Timothy Pratley timothyprat...@gmail.com wrote: Yet another way :) user= (map + (rest a) a) (3 5 7 9 11) wow! i like your solution! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure

Re: clojure-mode survey

2009-09-08 Thread Rickard Bennekom
I only use SLIME for inf-Lisp jobs. Clojure-update is a sensible complement to clojure-install, I'd strongly vote for keeping it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

Re: ns :require vs import

2009-09-08 Thread Kid Meier
On Sep 7, 10:40 pm, Sean Devlin francoisdev...@gmail.com wrote: Okay, syntax question.  When defining a namespace (ns my-ns   (:require [clojure.contrib [str-utils2 :as s]])   (:import (java.util Regex Date Etc))) Why does the require use a vector, and the import statement use a list?  

Re: refer from inside of ns macro?

2009-09-08 Thread tmountain
Nevermind... stupidly simple solution: (ns foo (:use bar)) -Travis On Sep 8, 8:11 am, tmountain tinymount...@gmail.com wrote: Is it possible to refer from inside of the ns macro rather than doing it after the fact? I've browsed the docs and don't see an obvious way to do this. Right now

Re: best way to make use of association lists

2009-09-08 Thread Conrad
Ah! ArrayMap! I missed that structure in the documentation! That was exactly what I'm looking for. On Sep 8, 1:09 am, Chouser chou...@gmail.com wrote: On Sep 7, 2009, at 5:19 PM, Conrad drc...@gmail.com wrote: Hi everyone! I have some data that consists of key/value pairs, but that need

VimClojure - OpenSolaris - What am I doing wrong?

2009-09-08 Thread Michael Aldred
G'day, I'm having a bit of trouble getting VimClojure working under OpenSolaris 2009.06 (I'm currently using the development IPS repository, however I still got the problem with the release repository). I'm compiled and installed vimclojure.jar, and ng. Vim correctly detects and highlights

Re: VimClojure - OpenSolaris - What am I doing wrong?

2009-09-08 Thread Michael Aldred
I've found the problem. The NailGun client assumes that the strlen function will handle a null pointer for the argument. Under Solaris this is not the case (http://technopark02.blogspot.com/ 2006/04/solaris-null-pointer-bugs-usrlib00so1.html) The problem is in sendText. With Nailgun 0.7.1,

Re: best way to make use of association lists

2009-09-08 Thread Conrad
Thanks again everyone for the helpful replies- The clojure community is definitely one of the languages's strengths. On Sep 7, 5:19 pm, Conrad drc...@gmail.com wrote: Hi everyone! I have some data that consists of key/value pairs, but that need to maintain their order, in terms of when they

Re: best way to make use of association lists

2009-09-08 Thread B Smith-Mannschott
On Tue, Sep 8, 2009 at 15:22, Conraddrc...@gmail.com wrote: Ah! ArrayMap! I missed that structure in the documentation! Well, I suspect there's a reason for that. That was exactly what I'm looking for. Be aware that ArrayMap is something that Clojure uses internally only to represent very

Re: Looping idiom

2009-09-08 Thread Sean Devlin
Very very slick :) On Sep 7, 11:39 pm, Timothy Pratley timothyprat...@gmail.com wrote: Yet another way :) user= (map + (rest a) a) (3 5 7 9 11) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group.

For Vimclojure users

2009-09-08 Thread Konrad Scorciapino
Hello, there! Do you rebind vimclojure's default commands? I'm currently remapping the most used ones, using [F9 F10 F11 F12] as [\et \p \ef \sr], and I wonder if there is a more productive key scheme. Cheers! -- Et Forum delendum est! --~--~-~--~~~---~--~~

Re: clojure-mode survey

2009-09-08 Thread Tom Faulhaber
Hi Phil, Speaking for myself, I only use SLIME emacs 23, though I certainly wouldn't want to force anyone to do those things. Also, one thing that I (and others) have noticed is that clojure mode chokes on the #^{} form metadata on namespaces. (See any of the files in clojure-contrib for an

Unsupported binding form

2009-09-08 Thread Gorsal
#CompilerException java.lang.Exception: Unsupported binding form: (G__1852 2) (NO_SOURCE_FILE:1182) So, I'm porting Paul Grahm's condlet macro to clojure. I've done it except when i evaluate it it gives me the above error. However, when I macroexpand-1 it it evaluates fine. The only difference

Re: dynamic :use

2009-09-08 Thread Laurent PETIT
Hello, So far there have been mentions of several techniques : = using macro against *db-adapter* : * will work if *db-adapter* is set at compile-time (in a top level expression before the macro call, or as a side effect of the invocation of another macro before the macro call). * if you

Re: Unsupported binding form

2009-09-08 Thread Laurent PETIT
What's your current condlet definition ? 2009/9/8 Gorsal s...@tewebs.com #CompilerException java.lang.Exception: Unsupported binding form: (G__1852 2) (NO_SOURCE_FILE:1182) So, I'm porting Paul Grahm's condlet macro to clojure. I've done it except when i evaluate it it gives me the above

Re: Unsupported binding form

2009-09-08 Thread Gorsal
(set! *print-level* 8) ;;so you can see all of macroexpand-1 ;;MISC Utilities ;; ;; (defn mklst [item] (if (list? item) item (list item))) (defn lassoc [item lst] (first (filter #(= (first (mklst %)) item) lst))) (defmacro llet [bind body] `(let ~(vec (mapcat

Library problem: SWT and Emacs

2009-09-08 Thread recent596
Hey everyone, I would really appreciate it if you guys could help me out: I've gotten really spoilt by LispWorks and now it's taking me forever to get sort these library loading issues out. Okay, so I've download clojure in a box, and the swt.jar library from the eclipse website and have the

Re: clojure-mode survey

2009-09-08 Thread Phil Hagelberg
Tom Faulhaber tomfaulha...@gmail.com writes: Also, one thing that I (and others) have noticed is that clojure mode chokes on the #^{} form metadata on namespaces. (See any of the files in clojure-contrib for an example.) I'm not able to reproduce the problem now, so if you don't already know

Re: Unsupported binding form

2009-09-08 Thread Laurent PETIT
Without digging into the implementation code: shouldn't the expansion for e.g. clojure.core/letfn return a vector and not a list for the binding ? ((G__1840 [a b c] (print a))) should be (vector (G__1840 [a b c] (print a))) or [(G__1840 [a b c] (print a))] ? Maybe clojure.core/letfn is

Another Clojure Box - Version 1.4 Fix!!!

2009-09-08 Thread Darmac
Hi, In the last version of ACB I make a mistake with SciTE version!! Thanks to all the people that have been using ACB from the very beginning that warn me that SciTE version wasn't the wright one. If you have download ACB1.4, please download SciTE.exe from this URL

Re: clojure-mode survey

2009-09-08 Thread Phil Hagelberg
Konrad Hinsen konrad.hin...@fastmail.net writes: On 8 Sep 2009, at 02:36, Phil Hagelberg wrote: However, now that clojure-mode has the M-x clojure-install command that sets up SLIME etc, I don't know if the built-in subprocess features are worth keeping around any more. Personally I have

Re: minor grievance with arithmetic on characters

2009-09-08 Thread Stephen C. Gilardi
On Sep 8, 2009, at 2:14 AM, Timothy Pratley wrote: According to the docstring compare returns -1, 0 or 1: user= (compare \b \g) -5 We could fix the doc along the lines of: Comparator. Returns a negative number, zero, or a positive number when x is logically 'less than', 'equal to', or

Re: clojure-mode survey

2009-09-08 Thread Rick Moynihan
Hi, I just wanted to say thanks on the M-x clojure-install feature of clojure-mode! I like some others on this thread used to use clojure-mode sans SLIME, (because SLIME and the need to upgrade didn't seem worth the installation hassle). However last week I saw clojure-mode's M-x

Re: Library problem: SWT and Emacs

2009-09-08 Thread Laurent PETIT
Seems like you've been bitten by a lock during the loading of the swt library/swt native library. I remember this happened to me, but I'm not quite sure what the solution was at that time (if I even found one, which, the more I think about it, was certainly not the case ...) 2009/9/8 recent596

Re: explode a string to a list

2009-09-08 Thread Conrad
Although this shows how to convert a string into a seq of chars, for the life of me I can't find a function in any libraries (or any info in the newsgroup) to do the reverse, i.e. (\t \e \s \t) = test... The closest I can find is (print-str [\t \e \s \t])=t e s t ...can anyone give me a

Re: explode a string to a list

2009-09-08 Thread Conrad
Never mind- I figured it out looking at the str-utils source... the answer is (apply str [\t \e \s \t]) On Sep 8, 6:05 pm, Conrad drc...@gmail.com wrote: Although this shows how to convert a string into a seq of chars, for the life of me I can't find a function in any libraries (or any info

Printing to be read

2009-09-08 Thread Brian Hurt
So I have a situation where I want to spool out a data structure as a file where I want to be able for a human to read modify this structure, and then be able to read it back in. At first I thought this was going to be easy- just use print to write out the structure, and then use read to read it

Re: Printing to be read

2009-09-08 Thread Richard Newman
So, my question is this: is there a way to print a structure out in a fashion that it can be read back in correctly (i.e. with strings being quoted), and without having to write my own print function? prn. user= (prn {:foo [bar 5.0]}) {:foo [bar 5.0]} nil

Re: Example of using ANTLR from Clojure?

2009-09-08 Thread psf
Thanks for the information. Once I bit the bullet and learned a bit of Java, it was actually pretty easy to call ANTLR from clojure, after getting all the package naming figured out. Paul On Sep 6, 6:22 am, Laurent PETIT laurent.pe...@gmail.com wrote: 2009/9/5 Mike Hinchey hinche...@gmail.com

Re: Unsupported binding form

2009-09-08 Thread Gorsal
Dang. I did indeed have to read the fine print. Sequences vs. lists. All look the same , don't they. Those macroexpanded things which looked like lists were actually sequences. This is because map and mapcat and such return ... sequences! (list? seq) returns false on a sequence... So. (defn

Re: minor grievance with arithmetic on characters

2009-09-08 Thread Timothy Pratley
Hi Steve, I find the -1, 0, 1 result more useful, but am also wary it hides some useful information. My preference would be to have the doc-string changed to what you proposed and keep the neg/pos behaviour of .compareTo in place. To get -1, 0, 1 requires a 'sign' operator which is handy to have

Re: clojure-mode survey

2009-09-08 Thread Phil Hagelberg
Rick Moynihan rick.moyni...@gmail.com writes: One problem I do have with clojure-mode/clojure is managing the classpaths for clojure projects... It seems that the typical elisp config only has one variable (which is then shared across all clojure files) for specifying the classpath...

Re: Clojure quickstart maven archetype

2009-09-08 Thread Daniel Renfer
I'm really glad someone finally got this working. I gave it a shot a couple of months ago and I was tearing my hair out trying to get a two way communication with the repl and the outside world. On Tue, Sep 8, 2009 at 2:41 AM, Scott Fleckensteinnullst...@gmail.com wrote: Thanks Stuart, Just