Re: ANN: try clojure

2010-05-13 Thread Michael Wood
On 13 May 2010 07:31, Heinz N. Gies wrote: > Hi people Raynes and me have figured the community has given us so much so it > is time to give something back. We took the effort of making a try-clojure - > hence since we are the sandbox guys who is more made for that then us :P. > > Anyway, enjoy:

Re: ANN: try clojure

2010-05-13 Thread Wilson MacGyver
Great work, but the tryhaskell link is wrong. It should be http://tryhaskell.org/ Sent from my iPad -- 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 mo

Re: how to develop patches to libraries

2010-05-13 Thread Alex Osborne
Brian Wolf writes: > Whats the idiomatic or best method to develop patches to pre-exisitng > libraries using clojars, do I git the source to my computer, put put > [lein-clojars "0.5.0"] in project file, obviously renaming the > project, and do I take original dependenicies out, or leave in, or

Re: Dumbest test Q you ever heard

2010-05-13 Thread Quzanti
I have written something to convince myself that things behave as I expected e.g. each runs only once per test, not once per assertion http://gist.github.com/399638 It handles the fact that tests can be run in any order by using a Set which gets added to when any function is run (so if the funct

Getting line numbers in stack traces

2010-05-13 Thread Brian Watkins
What is the method that gets line numbers and function names into stack traces? I know I can't get them in the Repl (because there aren't any), but I tried loading my file with load-file and that doesn't help either. -- You received this message because you are subscribed to the Google Groups "C

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

2010-05-13 Thread Fabio Kaminski
"(Clojure (*fight the system!*))" rsrsrs :) On Wed, May 12, 2010 at 1:18 AM, Armando Blancas wrote: > 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 tw

Re: Annoying auto-signature

2010-05-13 Thread feka
Well, the annoying fact is that it appears on all posts, but actually it should appear only on mails generated from posts. Would anyone browsing through the message archives be offended if no warnings and unsubscribe link were there? I get digest messages (I guess most of us does) and there should

Re: dump html with clojure

2010-05-13 Thread Eric Schulte
Wouldn't this be simpler with pmap, e.g. http://gist.github.com/399269 although to be honest I don't really know how the automatically parallelized clojure functions decide how many threads to use. Is the JVM smart enough to only create as many system-level threads as make sense on my hardware?

Re: dump html with clojure

2010-05-13 Thread Nurullah Akkaya
Yes but AFAIK you only get availableProcessors + 2 threads with pmap which is fine when the task is CPU bound but for downloading web pages most of the time will be lost at waiting for I/O so having more threads would speed things up. Regards... -- Nurullah Akkaya http://nakkaya.com On Thu, May

Re: code review request: clojure.java.io

2010-05-13 Thread Laurent PETIT
2010/5/13 Stuart Halloway : >>  * I also have bad feelings when I see the Coercions protocol defined >> but not used in conjunction with IOFactory for default behaviours > > There are very few examples of this, not worth making changing IMO. I'll try to do this as an exercise if time permits. I do

Splitting a string with the characters between each split?

2010-05-13 Thread joshua-choi
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" " " "

Re: dump html with clojure

2010-05-13 Thread Michael Gardner
On May 13, 2010, at 7:52 AM, Nurullah Akkaya wrote: > Yes but AFAIK you only get availableProcessors + 2 threads with pmap > which is fine when the task is CPU bound but for downloading web pages > most of the time will be lost at waiting for I/O so having more > threads would speed things up. Se

Destructuring namespace qualified map keys

2010-05-13 Thread David McNeil
Is there a way to destructure namespace qualified map keys? I want to do something like this: (let [{:keys (y)} {:y 20}]) Except with namespace qualified keys: (let [{:keys (?)} {:x/y 20}]) Thank you. -David McNeil -- You received this message because you are subscribed to the Google Groups

Re: Destructuring namespace qualified map keys

2010-05-13 Thread Adrian Cuthbertson
I don't think there's a way to do it with :keys, but could you use individual key destructuring? I.e; (let [{x :x/y} {:x/y 20}] x) 20 -Rgds, Adrian. On Thu, May 13, 2010 at 6:47 PM, David McNeil wrote: > Is there a way to destructure namespace qualified map keys? > > I want to do something like

Re: Destructuring namespace qualified map keys

2010-05-13 Thread David McNeil
> (let [{x :x/y} {:x/y 20}] x) > 20 That will work. Thank you! -David McNeil -- 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 pat

Re: ANN: try clojure

2010-05-13 Thread Raoul Duke
Bad Gateway The proxy server received an invalid response from an upstream server. Apache/2.0.63 (Unix) DAV/2 Server at www.try-clojure.org Port 80 On Wed, May 12, 2010 at 10:31 PM, Heinz N. Gies wrote: > Anyway, enjoy: http://www.try-clojure.org -- You received this message because you are s

Re: Getting line numbers in stack traces

2010-05-13 Thread MarkSwanson
On May 13, 6:11 am, Brian Watkins wrote: > What is the method that gets line numbers and function names into > stack traces?  I know I can't get them in the Repl (because there > aren't any), but I tried loading my file with load-file and that > doesn't help either. It's there; Clojure binds th

Re: dump html with clojure

2010-05-13 Thread Eric Schulte
Hi Nurullah, Nurullah Akkaya writes: > Yes but AFAIK you only get availableProcessors + 2 threads with pmap That's good to know, is this documented somewhere? > > which is fine when the task is CPU bound but for downloading web pages > most of the time will be lost at waiting for I/O so havin

What's up with require vs use vs import vs refer?

2010-05-13 Thread j-g-faustus
Hi, just started looking at Clojure, and it looks promising as a modern- day Lisp for practical use. I saw this presentation on Clojure: http://clojure.blip.tv/ and I wholeheartedly agree with the design principles. Unified access to all kinds of collections (list, array, struct, hash) is somethi

Re: What's up with require vs use vs import vs refer?

2010-05-13 Thread Brian Hurt
On Thu, May 13, 2010 at 2:06 PM, j-g-faustus wrote: > Hi, > > just started looking at Clojure, and it looks promising as a modern- > day Lisp for practical use. > > I saw this presentation on Clojure: http://clojure.blip.tv/ and I > wholeheartedly agree with the design principles. Unified access t

Re: What's up with require vs use vs import vs refer?

2010-05-13 Thread Stuart Halloway
There needs to be more than one thing, but what we have could definitely be simpler. Check out these threads and join the discussion: http://bit.ly/a76XSI (dev list ns overhaul discussion) http://bit.ly/ajcu74 (dev list "need" proposal) Stu Hi, just started looking at Clojure, and it loo

new Clojure Compiler...

2010-05-13 Thread Fabio Kaminski
Hi all, since clojure-dev its a managed list.. the question goes here.. i read somewhere that protocols was implemented thinking (inclusive) for natively clojure the compiler, at this moment implemented in java. so, my question is, is this gonna happen? and if so, in what version of clojure we w

Re: Getting line numbers in stack traces

2010-05-13 Thread Brian Watkins
Okay, I can get that stack trace, but there's no line for clojure.core/ divide in your trace. How would I know which function threw the exception? "eval" isn't very useful. Ideally I'd like a line number, too. If I have a function, (defn process [sequence] (map some-function sequence)) And

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

2010-05-13 Thread Drew Raines
You could do it by using the word boundary regexp operator. (ns foo.bar (:use [clojure.contrib.string :only [split]])) (defn split* [s] (drop 1 (split #"\b" s))) (split* "ab c de") ;; ("ab" " " "c" " " "de") -Drew On Thu, May 13, 2010 at 11:24, joshua-choi wrote: > I'd like to know i

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 betwe

Re: code review request: clojure.java.io

2010-05-13 Thread Stuart Halloway
I'm comfortable with the behavior implied for these corner cases. Stu Hi On 13 May 2010 03:02, Stuart Halloway wrote: * Decidedly, I have bad feelings when I read about the "magic" of "coercing" a String first as a URL, and if not possible, fall back and consider it a local absolute/re

Re: Getting line numbers in stack traces

2010-05-13 Thread MarkSwanson
On May 13, 4:32 pm, Brian Watkins wrote: > Okay, I can get that stack trace, but there's no line for clojure.core/ > divide in your trace.  How would I know which function threw the > exception?  "eval" isn't very useful.  Ideally I'd like a line number, > too. Right. It's strange I've never ev

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

2010-05-13 Thread Justin Kramer
clojure.contrib.string/partition does exactly what you're looking for. (require 'clojure.contrib.string) (clojure.contrib.string/partition #"\s+" "ab c de") ;; ("ab" " " "c" " " "de") Justin On May 13, 12:24 pm, joshua-choi wrote: > I'd like to know if there's a standard function similar to >

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

2010-05-13 Thread joshua-choi
Ah, thanks, I forgot about the word-boundary regex, but unfortunately, the regex I want to split on is more complicated than #"\s+"—I just used #"\s+" as an example, and I don't think #"\b" will work in this case. On May 13, 1:26 pm, Drew Raines wrote: > You could do it by using the word boundary

Re: code review request: clojure.java.io

2010-05-13 Thread Michael Wood
On 14 May 2010 04:32, Stuart Halloway wrote: >> On 13 May 2010 03:02, Stuart Halloway wrote:  * Decidedly, I have bad feelings when I read about the "magic" of "coercing" a String first as a URL, and if not possible, fall back and consider it a local absolute/relative path. I'