Re: the inverse function of load or load-file

2009-06-24 Thread ogcraft
Thanks a lot, Adrian. Adrian Cuthbertson wrote: > You can use the following; > > (defn frm-save > "Save a clojure form to file." > [#^java.io.File file form] > (with-open [w (java.io.FileWriter. file)] > (binding [*out* w *print-dup* true] (prn frm > > (defn frm-load > "Load a cloj

Re: macroexpand question

2009-06-24 Thread Emeka
kedu arasof I don't know why you should go for macro here, an ordinary function can do it. Emeka On Tue, Jun 23, 2009 at 12:24 AM, arasoft wrote: > > I just wrote my first practice macro, first without and then with > syntax quoting: > > (defmacro take-until1 [function sq] > (list 'take-while

Clojure and JAX-WS

2009-06-24 Thread Rock
I have almost succeeded in convincing the company I work for here in Italy to give Clojure a try, and see if it can be adopted for an important project. Now, the only problem is that, among other things, we need to implement a SOAP web service with JAX-WS (Java 6). This seems to be the most diffi

Re: Small question: Best way to create a map with vector vals

2009-06-24 Thread Nicolas Oury
Hello, other solutions: (apply hash-map (apply concat [[:a 1] [:b 3] [:e 5] [:c 1]])) or (apply hash-map (mapcat identity [[:a 1] [:b 3] [:e 5] [:c 1]])) I didn't find any function equivalent to "apply concat". Is there something like a monadic join function for sequence in the API? Best reg

Re: Small question: Best way to create a map with vector vals

2009-06-24 Thread Emeka
Have you tried zipmap? Emeka On Tue, Jun 23, 2009 at 10:09 PM, samppi wrote: > > The idiom (into {} coll-of-entries) is often used to create a map from > a collection of entries or two-sized vectors. But what if I want to do > something like this: > > (mystery-fn [[:a 1] [:b 3] [:b 5] [:c 1]])

Newbie Question on re-split

2009-06-24 Thread John Carnell
Hi guys, I am stuck and I am hoping someone can help me with this as I have been stuck. I am working in the REPL and when I call the re-split function user=> (re-split #"\W+" "This is simple sentence") I get the results properly. However, if I try to wrap the same call within a function passi

(type (doall x))

2009-06-24 Thread Volker Sarodnick
Hello, I'm rather new to clojure and still fighting with the basics. Just new I wondering why (type (doall x)) is still clojure.lang.LazySeq? Probably easy but I get no clue, could anyone help? user> (def x (range 0 (* 2.0 Math/PI) 0.1)) #'user/x user> (ns user (:require [clojure.contrib.gener

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-24 Thread Matthew Erker
I second that vote. (Though I prefer Clipse, which is somewhat taken.) On Jun 23, 6:47 pm, Rayne wrote: > I vote Corona. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-24 Thread Matt Wilson
Clipse? On Jun 24, 4:21 am, Laurent PETIT wrote: > What about eclipjure ? > > 2009/6/23 Christophe Grand > > > > > On Tue, Jun 23, 2009 at 5:56 PM, Laurent PETIT > > wrote: > > >> 2009/6/23 Christophe Grand > > >>> On Tue, Jun 23, 2009 at 1:47 PM, Laurent PETIT > >>> wrote: > > * ecloju

(type (doall x))

2009-06-24 Thread Volker
Hello, I'm rather new to clojure and still fighting with the basics. Just new I wondering why (type (doall x)) is still clojure.lang.LazySeq? Probably easy but I get no clue, could anyone help? user> (def x (range 0 (* 2.0 Math/PI) 0.1)) #'user/x user> (ns user (:require [clojure.contrib.gener

Re: Recursive function that does not terminate!

2009-06-24 Thread Rich Hickey
On Tue, Jun 23, 2009 at 8:02 PM, Stephen C. Gilardi wrote: > > On Jun 23, 2009, at 6:22 PM, pupsik wrote: > >> The following recursive function does not >> terminate if I exexute it in my REPL. >> What is wrong? >> (This example is from the official Clojure-website). >> >> (defn my-zipmap [keys va

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-24 Thread Antony Blakey
eclisp :) On 24/06/2009, at 11:05 AM, Matthew Erker wrote: > > I second that vote. > (Though I prefer Clipse, which is somewhat taken.) > > > On Jun 23, 6:47 pm, Rayne wrote: >> I vote Corona. > > > Antony Blakey - CTO, Linkuistics Pty Ltd Ph: 0438 840 787 There are two ways of co

Re: Small question: Best way to create a map with vector vals

2009-06-24 Thread Laurent PETIT
Oups, indeed this doesn't solve the problem, this other solution works (just a variant of Kresimir's one) : (reduce (fn [m [k v]] (update-in m [k] #(conj (or %1 []) %2) v)) {} [[:a 1] [:b 3] [:b 5] [:c 1]]) 2009/6/24 Laurent PETIT > Does this fit your need ? : > > (reduce (fn [m [k v]] (assoc m

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-24 Thread Laurent PETIT
Hi all, Among the last interesting proposals, some seem not possible to follow, because the names are already used : corona : sounded good, but already used (and it's even an eclipse subproject) Eclisp: already used by a lisp project for eclipse clipse: not really used, but very closed to eclipse

Re: How can I stop "leaking" memory?

2009-06-24 Thread Rich Hickey
On Wed, Jun 24, 2009 at 1:43 AM, Christophe Grand wrote: > On Wed, Jun 24, 2009 at 7:02 AM, Four of Seventeen > wrote: >> >> (defn top [n comptr coll] >>  (let [m (reduce #(assoc %1 %2 true) (sorted-map-by comptr) >>            (take n coll))] >>    (keys >>      (reduce #(let [t (assoc %1 %2 tru

Re: Moving Window Function

2009-06-24 Thread Rich Hickey
On Wed, Jun 24, 2009 at 2:20 AM, Christophe Grand wrote: > On Tue, Jun 23, 2009 at 11:59 PM, Daniel Lyons > wrote: >> >> But if I try it with your original number (10x bigger than mine) I run out >> of Java heap space. Which didn't happen before either, because the lists >> weren't materialized.

How to generically coerce a number to the class of another number???

2009-06-24 Thread arasoft
Is there a way to avoid having to use a function like this (defn coerce-primitive-integer [value to-class] (cond (= to-class java.lang.Byte) (byte value) (= to-class java.lang.Short) (short value) (= to-class java.lang.Integer) (int value) (= to-class java.lang.L

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-24 Thread Wilson MacGyver
At the risk of suggesting another name that start with conj, how about Conjunction? Eclipses happens when sun and moon are in conjunction. And it does start with conj. On Jun 24, 2009, at 8:02 AM, Laurent PETIT wrote: > Hi all, > > Among the last interesting proposals, some seem not possib

Re: (type (doall x))

2009-06-24 Thread Konrad Hinsen
On Jun 24, 2009, at 11:24, Volker wrote: > I'm rather new to clojure and still fighting with the > basics. Just new I wondering why (type (doall x)) is still > clojure.lang.LazySeq? Probably easy but I get no clue, could > anyone help? A lazy seq is a data structure whose elements are built on d

Re: Newbie Question on re-split

2009-06-24 Thread Teemu Antti-Poika
On Jun 24, 4:36 am, John Carnell wrote: > (defn split-by-whitespace [sentence]( >    (re-split #"\W+" sentence) >    )) > Try removing the extra parenthesis: (defn split-by-whitespace [sentence] (re-split #"\W+" sentence)) Teemu --~--~-~--~~~---~--~~ You rec

Re: (type (doall x))

2009-06-24 Thread Volker
Thank you: (map gmath/sin x) did the trick! Volker --~--~-~--~~~---~--~~ 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: Clojure and JAX-WS

2009-06-24 Thread Rock
No response. Not even a single SOAP web service server implemented in Clojure yet? Rock On Jun 24, 11:15 am, Rock wrote: > I have almost succeeded in convincing the company I work for here in > Italy to give Clojure a try, and see if it can be adopted for an > important project. > > Now, the o

(create-struct) without keys.

2009-06-24 Thread Nicolas Oury
Dear all, Sometimes, when I write some macros and applied them to special case, I got a "create-struct : must supply keys" exception. I think it should be possible to write (create-struct) and have an empty structure definition returned. With (struct (create-struct)) more or less equivalent to

Re: Clojure and JAX-WS

2009-06-24 Thread J. McConnell
On Wed, Jun 24, 2009 at 5:15 AM, Rock wrote: > > I have almost succeeded in convincing the company I work for here in > Italy to give Clojure a try, and see if it can be adopted for an > important project. > > Now, the only problem is that, among other things, we need to > implement a SOAP web se

Re: (create-struct) without keys.

2009-06-24 Thread Mark Volkmann
On Wed, Jun 24, 2009 at 10:07 AM, Nicolas Oury wrote: > > Dear all, > > Sometimes, when I write some macros and applied them to special case, I > got a "create-struct : must supply keys" exception. > > I think it should be possible to write (create-struct) and have an empty > structure definition

Re: Recursive function that does not terminate!

2009-06-24 Thread Cosmin Stejerean
On Wed, Jun 24, 2009 at 6:42 AM, Rich Hickey wrote: > > On Tue, Jun 23, 2009 at 8:02 PM, Stephen C. Gilardi > wrote: > > > > On Jun 23, 2009, at 6:22 PM, pupsik wrote: > > > >> The following recursive function does not > >> terminate if I exexute it in my REPL. > >> What is wrong? > >> (This exam

Are keywords and symbols garbage-collected?

2009-06-24 Thread samppi
Are keywords and symbols garbage-collected? If I generated a lot of keywords or symbols, put them into a collection, and then removed them, would they disappear and free up space? I'm wondering if they're similar to Ruby symbols, which are never garbage collected. --~--~-~--~~

Re: generating java classes at runtime

2009-06-24 Thread RD
I wont be extending classes or interface since I have to generate classes on the fly, reading some arbitrary xml schemas at runtime. I'm thinking of just parsing the xml schema in clojure and generating a list (which would contain a text representation of how I would generate a normal java cl

Re: (create-struct) without keys.

2009-06-24 Thread Nicolas Oury
This is useful when you write a macro that generates a structure with a known set of fields at macro-expansion time. But sometimes this known set of fields will be empty. ( Imagine a macro allowing to shortly write some kind of records with some attributes modified/added/ removed by the macro.

Re: Clojure and JAX-WS

2009-06-24 Thread Rock
OK. Will try that. Thanks for the tip. On Jun 24, 5:21 pm, "J. McConnell" wrote: > On Wed, Jun 24, 2009 at 5:15 AM, Rock wrote: > > > I have almost succeeded in convincing the company I work for here in > > Italy to give Clojure a try, and see if it can be adopted for an > > important project

Re: (create-struct) without keys.

2009-06-24 Thread Michael Reid
On Wed, Jun 24, 2009 at 11:41 AM, Nicolas Oury wrote: > > This is useful when you write a macro that generates a structure with a > known set of fields at macro-expansion time. But sometimes this > known set of fields will be empty. > > ( Imagine a macro allowing to shortly write some kind of reco

Re: (create-struct) without keys.

2009-06-24 Thread Nicolas Oury
On Wed, 2009-06-24 at 11:53 -0400, Michael Reid wrote: > > > > (if (empty? keys_generated_by_macro) > > (defn ...) > > (let [my_struct ...] )) > > > > Resulting in code duplication: less readable, harder to modify, error > > prone. > > ) > > > You could do: > > `(let [my-struct (if (empt

Re: Are keywords and symbols garbage-collected?

2009-06-24 Thread Stephen C. Gilardi
On Jun 24, 2009, at 11:31 AM, samppi wrote: Are keywords and symbols garbage-collected? If I generated a lot of keywords or symbols, put them into a collection, and then removed them, would they disappear and free up space? I'm wondering if they're similar to Ruby symbols, which are never garba

Protecting Mutable State In The State Monad

2009-06-24 Thread Konrad Hinsen
For those interested in applications of monads, here's a new blog post (going with a new library in clojure.contrib) about monadic I/O: http://onclojure.com/2009/06/24/protecting-mutable-state-in-the- state-monad/ Konrad. --~--~-~--~~~---~--~~ You rec

Re: How can I stop "leaking" memory?

2009-06-24 Thread Four of Seventeen
On Jun 24, 2:43 am, Christophe Grand wrote: > On Wed, Jun 24, 2009 at 7:53 AM, Richard Newman wrote: > > > > Even with the optimization, sort somehow beats top for speed. It looks > > > like top is best used to avoid major memory consumption for long seqs; > > > if you have the memory and need t

Re: (create-struct) without keys.

2009-06-24 Thread Stephen C. Gilardi
On Jun 24, 2009, at 11:07 AM, Nicolas Oury wrote: I think it should be possible to write (create-struct) and have an empty structure definition returned. With (struct (create-struct)) more or less equivalent to creating an empty map. I agree that this would fit with the "graceful underflow

ANN: Coders at Work: The Lisp Perspective / Introduction to Clojure

2009-06-24 Thread nallen05
Sunday, July 19th in the big conference room at Franz Inc in downtown Oakland: 6:00pm ~ Meet in front of the Franz office (2201 Broadway, Suite 715, Oakland, CA 94612). The kind folks at Franz Inc will herd us cats up to their big conference room before 6:15. 6:15pm ~ Introduction to Clojure Am

Re: How to generically coerce a number to the class of another number???

2009-06-24 Thread Meikel Brandmeyer
Hi, Am 24.06.2009 um 14:21 schrieb arasoft: Is there a way to avoid having to use a function like this (defn coerce-primitive-integer [value to-class] (cond (= to-class java.lang.Byte) (byte value) (= to-class java.lang.Short) (short value) (= to-class java.lang.Integer) (

Re: How can I stop "leaking" memory?

2009-06-24 Thread Four of Seventeen
On Jun 24, 12:28 pm, Four of Seventeen wrote: > user=> (defmacro nanotime [& body] `(let [start (System/nanotime)] > ~...@body (- (System/nanotime) start))) > #'user/nanotime user=> (defmacro nanotime [& body] `(let [start# (System/nanotime)] ~...@body (- (System/nanotime) start#))) #'user/nanot

Re: Clojure and JAX-WS

2009-06-24 Thread Sean Devlin
How about a combination of the following tools instead of the Java API: c.c.prxml c.c.duck-streams compojure I haven't tried this, and I have never worked with SOAP, so take it with an appropriately sized grain of salt. On Jun 24, 1:09 pm, Richard Newman wrote: > > No response. > > > Not even

Re: generating java classes at runtime

2009-06-24 Thread chris
Yes that is feasible. You might consider just writing out a file and calling "load-file". Then you have an artifact should you wish to debug later. This will do the necessary compilation step before giving you access to any contents. Chris On Jun 24, 9:35 am, RD wrote: > I wont be extending c

Re: Clojure and JAX-WS

2009-06-24 Thread Richard Newman
> No response. > > Not even a single SOAP web service server implemented in Clojure yet? I have implemented other Java entities that "required" annotations -- they didn't require them, it was just a much more succinct alternative to an XML configuration file. You might want to investigate if

Re: Are keywords and symbols garbage-collected?

2009-06-24 Thread Four of Seventeen
On Jun 24, 12:22 pm, "Stephen C. Gilardi" wrote: > On Jun 24, 2009, at 11:31 AM, samppi wrote: > > > Are keywords and symbols garbage-collected? If I generated a lot of > > keywords or symbols, put them into a collection, and then removed > > them, would they disappear and free up space? I'm wond

Re: Are keywords and symbols garbage-collected?

2009-06-24 Thread Stephen C. Gilardi
On Jun 24, 2009, at 1:30 PM, Four of Seventeen wrote: On Jun 24, 12:22 pm, "Stephen C. Gilardi" wrote: Symbol objects are subject to garbage collection, but the "namespace" and "name" strings that identify them are not. Those strings are "interned" via the "intern" method on java.lang.String.

Re: (create-struct) without keys.

2009-06-24 Thread Nicolas Oury
On Wed, 2009-06-24 at 12:36 -0400, Stephen C. Gilardi wrote: > This would break the current (perhaps unimportant) invariant that > struct returns a PersistentStructMap. If keeping that invariant is > desirable, similar changes could be made within > PersistentStructMap.java instead. It see

ns exports

2009-06-24 Thread tsuraan
Does clojure still have a concept of a namespace's exports? I'd like to be able to list, in my ns declaration, the "publicly available" functions that my module has, but I'm not seeing any way to do this. It looks like there used to be an export function, and an ns-exports function to query the e

Concatenating Regexes?

2009-06-24 Thread CuppoJava
Hi, I need to dynamically create a regex, and would really like to be able to use Clojure's built-in regex syntax. But I don't know how to go about it. My regex is: #"(.*?)(\(image .*)" except instead of "image", I need to dynamically insert an array of possible strings to match. ie. given ["im

Re: ns exports

2009-06-24 Thread Stephen C. Gilardi
On Jun 24, 2009, at 5:52 PM, tsuraan wrote: Does clojure still have a concept of a namespace's exports? I'd like to be able to list, in my ns declaration, the "publicly available" functions that my module has, but I'm not seeing any way to do this. It looks like there used to be an export func

Re: Are keywords and symbols garbage-collected?

2009-06-24 Thread samppi
Thanks for the answers. I need to generate symbols to distinguish them from strings in a parser. It seems, then, that it's better to use symbols rather than keywords in this case. On Jun 24, 10:52 am, "Stephen C. Gilardi" wrote: > On Jun 24, 2009, at 1:30 PM, Four of Seventeen wrote: > > > > > O

Small question: inserting something at the beginning of a vector

2009-06-24 Thread samppi
Currently, if I want to do this: (mystery-fn [0 1 2 3 4] -1) -> [-1 0 1 2 3 4]), I use vec and cons: (vec (cons a-vec obj-to-insert)). Is there a better way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" gr

Re: Small question: inserting something at the beginning of a vector

2009-06-24 Thread CuppoJava
I personally use (concat [-1] [0 1 2 3 4]), but I've never been happy with that either. I would be interested in the proper way of doing this also. -Patrick --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" g

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-24 Thread thearthur
if we addopt this one it will need a TARP option under the bailout menu On Jun 23, 6:05 pm, verec wrote: > A bit facetious, I know, but a not too sarcastic pun on the > current economic climate ... > > foreclojure > > :-) > > Has good Googleability too :-) > > On Jun 23, 5:21 pm, Laurent PETIT

Re: Small question: inserting something at the beginning of a vector

2009-06-24 Thread arasoft
This also works: (into [-1] [0 1 2 3 4]) but I am more than uncertain whether it is "proper". On Jun 25, 12:26 am, CuppoJava wrote: > I personally use (concat [-1] [0 1 2 3 4]), but I've never been happy > with that either. I would be interested in the proper way of doing > this also. >   -Patri

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-24 Thread Mike Hinchey
I vote for EclipseClojure or eclipse-clojure. It's not as fun as some of the others, but do you really need a distinct brand on this project? I think easy to understand and search for is better. As Clojure becomes more mainstream, people won't care about a clever name of this project, they just

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-24 Thread e
Eclipse Plugin for Clojure (EP4C) On Wed, Jun 24, 2009 at 6:44 PM, Mike Hinchey wrote: > I vote for EclipseClojure or eclipse-clojure.  It's not as fun as some of > the others, but do you really need a distinct brand on this project?  I > think easy to understand and search for is better.  As Clo

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-24 Thread e
or EP4CD Eclipse Plugin for Clojure Development. On Wed, Jun 24, 2009 at 6:49 PM, e wrote: > Eclipse Plugin for Clojure (EP4C) > > On Wed, Jun 24, 2009 at 6:44 PM, Mike Hinchey wrote: >> I vote for EclipseClojure or eclipse-clojure.  It's not as fun as some of >> the others, but do you really ne

Re: Small question: inserting something at the beginning of a vector

2009-06-24 Thread Stephen C. Gilardi
On Jun 24, 2009, at 6:44 PM, arasoft wrote: This also works: (into [-1] [0 1 2 3 4]) but I am more than uncertain whether it is "proper". Generally, the need to insert at the beginning of a vector should trigger some close scrutiny as to whether vector is the right data type to use in thi

Question regarding example in Stuart Halloway's book (page 120)

2009-06-24 Thread arasoft
Why does this work? (take-while (complement #{\a\e\i\o\u}) "the-quick-brown-fox") When I do something similar, like (take-while (complement #(Character/isWhitespace %)) "the-quick-brown- fox") I have to deal with the parameter explicitly ("%"). How is the parameter hidden in the set/function?

Re: Concatenating Regexes?

2009-06-24 Thread Stephen C. Gilardi
On Jun 24, 2009, at 6:13 PM, CuppoJava wrote: Is there a nice way of doing this without having to go back to using Java's string syntax? I don't see a nice way to do it. You can use either (java.util.rexex.Pattern/compile my-str) or (with-in-str (str \# \" my-str \") (read)) to crea

Re: Question regarding example in Stuart Halloway's book (page 120)

2009-06-24 Thread Richard Newman
> Why does this work? > > (take-while (complement #{\a\e\i\o\u}) "the-quick-brown-fox") > > When I do something similar, like > > (take-while (complement #(Character/isWhitespace %)) "the-quick-brown- > fox") > > I have to deal with the parameter explicitly ("%"). How is the > parameter hidden in

Re: Question regarding example in Stuart Halloway's book (page 120)

2009-06-24 Thread Stephen C. Gilardi
On Jun 24, 2009, at 7:02 PM, arasoft wrote: Why does this work? (take-while (complement #{\a\e\i\o\u}) "the-quick-brown-fox") When I do something similar, like (take-while (complement #(Character/isWhitespace %)) "the-quick-brown- fox") I have to deal with the parameter explicitly ("%"). Ho

Re: Question regarding example in Stuart Halloway's book (page 120)

2009-06-24 Thread arasoft
Thank you for a comprehensive explanation!!! On Jun 25, 1:17 am, Richard Newman wrote: > > Why does this work? > > > (take-while (complement #{\a\e\i\o\u}) "the-quick-brown-fox") > > > When I do something similar, like > > > (take-while (complement #(Character/isWhitespace %)) "the-quick-brown-

Re: Question regarding example in Stuart Halloway's book (page 120)

2009-06-24 Thread Rich Hickey
On Wed, Jun 24, 2009 at 7:18 PM, Stephen C. Gilardi wrote: > > On Jun 24, 2009, at 7:02 PM, arasoft wrote: > >> Why does this work? >> >> (take-while (complement #{\a\e\i\o\u}) "the-quick-brown-fox") >> >> When I do something similar, like >> >> (take-while (complement #(Character/isWhitespace %))

Re: Concatenating Regexes?

2009-06-24 Thread Asbjørn Bjørnstad
On Jun 25, 6:13 am, CuppoJava wrote: > Hi, > I need to dynamically create a regex, and would really like to be able > to use Clojure's built-in regex syntax. But I don't know how to go > about it. > > My regex is: #"(.*?)(\(image .*)" > > except instead of "image", I need to dynamically insert

Re: Concatenating Regexes?

2009-06-24 Thread Chouser
On Wed, Jun 24, 2009 at 6:13 PM, CuppoJava wrote: > > I need to dynamically create a regex, and would really like to be able > to use Clojure's built-in regex syntax. But I don't know how to go > about it. > > My regex is: #"(.*?)(\(image .*)" > > except instead of "image", I need to dynamically i

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-24 Thread Tim Gilbert
+1 from me. I don't think extremely literal names are bad things where plugins are concerned. Tim Mike Hinchey wrote: > I vote for EclipseClojure or eclipse-clojure. It's not as fun as some > of the others, but do you really need a distinct brand on this > project? I think easy to understa

Re: Concatenating Regexes?

2009-06-24 Thread CuppoJava
Thanks for all your help guys. Chouser's solution seems to be the best that can be done so far. It's funny, before I learned Clojure, I wouldn't give a second thought to string twiddling like this. But ever since learning Clojure, I've been pretty reluctant to do anything messy. Thanks again -

HOWTO: Update the docs on clojure.org?

2009-06-24 Thread Seth
Tonight I got worked up enough to gripe to the good folks in IRC about the docs on clojure.org. For the most part they are solid, but more often than I'd like a link into the api page has a bad anchor. (nthrest) became (nthnext) in early Feb 2009. That's a pretty trivial update, but I can't seem t

I must be blind. No matching method found?

2009-06-24 Thread CuppoJava
Hi guys, I'm having the hardest time figuring out why this won't run. I've been staring at it for the last half hour, and it's only a single line. Another pair of eyes would be beneficial I think. (.substring (StringBuilder. "i must be blind") 4) (.substring (StringBuilder. "i must be blind") (in

Re: I must be blind. No matching method found?

2009-06-24 Thread liebke
That's strange, both work for me. user=> (.substring (StringBuilder. "i must be blind") 4) "st be blind" user=> (.substring (StringBuilder. "i must be blind") (int 4)) "st be blind" On Jun 24, 9:59 pm, CuppoJava wrote: > Hi guys, > I'm having the hardest time figuring out why this won't run.

Re: I must be blind. No matching method found?

2009-06-24 Thread CuppoJava
Thank you for verifying it for me. Maybe I need a restart or something. --~--~-~--~~~---~--~~ 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 fro

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-24 Thread sailormoo...@gmail.com
Sorry but it's a bit off-topic, any one tried running compojure in REPL in clojure eclipse plug-in?? I failed with that while it works in Netbeans plug-in.Any help? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Re: I must be blind. No matching method found?

2009-06-24 Thread CuppoJava
Okay. I did a restart and downloaded the latest Clojure version. Now I get a different error. I have no idea what's going on. (.substring (StringBuilder. "adsfagdsaga") 4) java.lang.IllegalArgumentException: Can't call public method of non- public class: public java.lang.String java.lang.Abstrac

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-24 Thread T. Ettinger
EP4C sounds good, but... as EP4C.org describes itself, "Everyday People 4 Christ is a Christian ministry moving throughout Los Angeles to meet the spiritual needs of everyday people." EP4CD has even worse Google-ability, returning results for every CD version of the 4th EP of a musician! So, how

Re: I must be blind. No matching method found?

2009-06-24 Thread Cosmin Stejerean
On Wed, Jun 24, 2009 at 8:59 PM, CuppoJava wrote: > > Hi guys, > I'm having the hardest time figuring out why this won't run. I've been > staring at it for the last half hour, and it's only a single line. > Another pair of eyes would be beneficial I think. > > (.substring (StringBuilder. "i must b

Re: I must be blind. No matching method found?

2009-06-24 Thread Adrian Cuthbertson
There was a post a few days ago about a StringBuilder problem on MacOs Java 1.5. I think this is the same problem (i.e Java not Clojure). Rgds, Adrian. On Thu, Jun 25, 2009 at 4:52 AM, Cosmin Stejerean wrote: > > > On Wed, Jun 24, 2009 at 8:59 PM, CuppoJava wrote: > >> >> Hi guys, >> I'm having

Re: I must be blind. No matching method found?

2009-06-24 Thread Glen Stampoultzis
Seems to fine under Windows XP: user> (.substring (StringBuilder. "i must be blind") 4) "st be blind" 2009/6/25 Adrian Cuthbertson > There was a post a few days ago about a StringBuilder problem on MacOs Java > 1.5. I think this is the same problem (i.e Java not Clojure). > > Rgds, Adrian. > >

Re: I must be blind. No matching method found?

2009-06-24 Thread CuppoJava
Thanks for the tip Adrian, I configured my REPL to start using Java 1.6 instead, and everything works now. Thanks to everyone else for verifying that it's not something I did wrong. -Patrick --~--~-~--~~~---~--~~ You received this message because you are subscrib

Foreclojure

2009-06-24 Thread fft1976
I know some of you are searching for names for your projects. I just wanted to say that "Foreclojure" is taken! This will be an open-source (but not GPL) accounting software in Clojure. Stay tuned. --~--~-~--~~~---~--~~ You received this message because you are subs

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-24 Thread Richard Newman
> +1 from me. I don't think extremely literal names are bad things > where > plugins are concerned. Indeed, having "Clojure" and "Eclipse" in the name is a big win for searchability... and who's thinking about the clever name when they're using it? --~--~-~--~~~---

Improved Error Messages - Part XXXVIII

2009-06-24 Thread Mark Addleman
Searching through this forum, I found many posts relating to improving Clojure's error messages. I stumbled across one where Rich makes a plea for concrete suggestions to specific cases. I'm very sympathetic to that, so I'd like to start a thread of specific coding errors that I've run across wh

Re: I must be blind. No matching method found?

2009-06-24 Thread Mark Derricutt
I'm suspecting you're compiling one part of your code under 1.6, and running under 1.5 (or vice versa) and some internal APIs have changed their return types slightly - causing all manner of oddness. I've had this before when one of the 1.6 methods returns a CharSequence instead of a String under

[OT] Convincing others about Clojure

2009-06-24 Thread Baishampayan Ghose
Hello, So I have been a Common Lisp user for quite sometime and at my earlier work we managed to build a state-of-the-art Travel portal in CL with a very small team of CL programmers. This was all fine except one thing. The management never really believed in Lisp and they eventually replaced the

Re: Foreclojure

2009-06-24 Thread Laurent PETIT
ok, thanks for the info ! 2009/6/25 fft1976 > > I know some of you are searching for names for your projects. I just > wanted to say that "Foreclojure" is taken! This will be an open-source > (but not GPL) accounting software in Clojure. Stay tuned. > > > --~--~-~--~~~--

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-24 Thread Laurent PETIT
2009/6/25 T. Ettinger > > EP4C sounds good, but... as EP4C.org describes itself, "Everyday > People 4 Christ is a Christian ministry moving throughout Los Angeles > to meet the spiritual needs of everyday people." EP4CD has even worse > Google-ability, returning results for every CD version of t

Re: Improved Error Messages - Part XXXVIII

2009-06-24 Thread Timothy Pratley
Here are some of my common mistakes: user=> (def data (ref {})) #'user/data user=> (dosync alter data assoc :a "a") "a" user=> (dosync (alter data assoc :a "a")) {:a "a"} ;; leaving out the parenthesis on a dosync can be silent and fatal, like a ninja (if-let [a 1] (println a) a (inc c))

Re: [OT] Convincing others about Clojure

2009-06-24 Thread Konrad Hinsen
On 25.06.2009, at 07:59, Baishampayan Ghose wrote: > Their concerns are thus: > > 1. How do you get Clojure programmers? Lisp is not for the faint > hearted. No idea on that one... > 2. What about the performance of Clojure? Is it fast? Define "fast"! It all depends on what you do... I'd re

Re: Convincing others about Clojure

2009-06-24 Thread Timothy Pratley
> 1. How do you get Clojure programmers? Lisp is not for the faint hearted. Clojure is extremely easy to learn compared to 'Lisp': You get collection based functions that apply other functions map/ reduce/filter You get simple powerful data structures hashmaps sets vectors lists You get atomic, t

Re: [OT] Convincing others about Clojure

2009-06-24 Thread Baishampayan Ghose
Konrad Hinsen wrote: > You could try to point out real-life programs that were written in > Lisp, including Clojure. Thanks Konrad. Can you point out some Clojure success stories that I can quote? I know about Stuart's AltLaw.org. Anything else that is documented or can be seen? Regards, BG

Roadmap of Clojure 1.1

2009-06-24 Thread michael frericks
Hello, i am a little bit lost about the roadmap of clojure 1.1. Is there anywhere an (evolving) list available of a) new features planned, b) things that break Clojure 1.0 c) and maybe removed features? Thanks Michael --~--~-~--~~~---~--~~ You received this mes