Re: Splitting a string with the characters between each split?

2010-05-13 Thread kredaxx
(defn split-two
[regexp string ch]
(interpose ch (split regexp string)))

(split-two #"\s+" "ab c de" "") #=> ("ab" "" "c" "" "de")

On May 13, 6:24 pm, joshua-choi  wrote:
> I'd like to know if there's a standard function similar to
> clojure.contrib.string/split that includes the characters between the
> spitted string, or if there isn't one, how I might write one. In other
> words, I'd like a function split* such that (split* #"\s+" "ab c  de")
> returns ("ab" " " "c" "  " "de").
>
> --
> 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 post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/clojure?hl=en

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: labrepl isn't a project in netbeans 6.8 - (Ubuntu 10.04)

2010-06-19 Thread kredaxx
Find the Maven plugin in the NB's plugin section and install if you
don't have it. It *might* help. At least that's what fixed it for my
NB installation.

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: usage examples in clojure api docs

2010-07-02 Thread kredaxx
On 2 Lip, 09:46, Justin Kramer  wrote:
> Partly in response to this issue and partly to get my feet wet with
> Ring and friends, I spent the last few nights writing a proof-of-
> concept Wiki to collect structured Clojure usage examples:
>
> http://clojure-examples.appspot.com/
>
> Here's a sample function page:
>
> http://clojure-examples.appspot.com/clojure.core/contains%3F
>
> I tried to come up with something that encourages a many-hands
> approach while maintaining structure and quality. There are plenty of
> missing features, but it should be easy for anyone interested to jump
> in and write some examples. It uses a modified version of Markdown for
> syntax. Content could be exported/parsed en masse relatively easily.
>
> The source is on GitHub:http://github.com/jkk/clj-wiki
>
> Does this seem like a worthwhile approach?
>
> Justin

Great! I was thinking lately of building something similar with the
same kind of approach.

One suggestion: the core functions should be structured into
categories rather than listed alphabetically., that is for example:

Maps
 - fn1
 - fn2
 - fn3
Vectors
 - fn3
 - fn4
 - fn5
Arithmetic
 - fn6
 - fn7
 - fn8
etcetera.

(Similar to what is in the cheat sheet)

This would eliminate the tersness and it would be much easier to find
a specific function (handy for newcomers to clojure)

Other than that great job, I think it has big potential. It's clean,
and easy to contribute. I will surely add some examples later today.


-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en