Re: Help needed: Clojure wikibook is desperately in need of cleanup!

2008-11-24 Thread Timothy Pratley
Hi Jarkko, Good changes, the main page was getting hellishly long. > (I wiped the old examples subpage as it was just an unorganised > collection showing usage of standard library functions. If someone is > feeling up to it, you can salvage it from the page history and > incorporate it into the

Re: Adapting a functional pretty-printer to Clojure

2008-11-24 Thread [EMAIL PROTECTED]
On Nov 25, 12:50 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Nov 25, 12:22 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > This approach might just be too inefficient -- perhaps it would be > > best to implement the pretty-printer in an imperative style after all. > > OTOH

Re: Adapting a functional pretty-printer to Clojure

2008-11-24 Thread [EMAIL PROTECTED]
On Nov 25, 12:22 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > This approach might just be too inefficient -- perhaps it would be > best to implement the pretty-printer in an imperative style after all. OTOH it is pretty darn nifty... user> (pp (clojure.xml/parse "http://catless.ncl.ac

Re: Adapting a functional pretty-printer to Clojure

2008-11-24 Thread [EMAIL PROTECTED]
On Nov 24, 8:17 pm, Chouser <[EMAIL PROTECTED]> wrote: > One option: You could use a seq instead of all the various structs. I took your advice and uploaded the rewrite to the files section in Google Groups, filename is pretty-printer.clj. It doesn't get a stack overflow anymore, but it runs out

Re: learning clojure

2008-11-24 Thread Ethan Herdrick
For the File / IO things, skip the Java libs - they are pretty low level. Go with the Jakarta Commons libs: http://commons.apache.org/io/description.html , as Stuart has recommended elsewhere. On Mon, Nov 24, 2008 at 6:48 AM, Stuart Sierra <[EMAIL PROTECTED]> wrote: > > It's useful to know the s

Re: Isolating I/O and other side-effects?

2008-11-24 Thread Michael Reid
> Is there anyway to assert that code does have side effects & should > never be called in a transaction? > > (dosync > (assert (not (in-transaction -> "Assert: Can't call this code in > a transaction" > > That could be useful for debug builds of IO libraries. I don't know that there's anyth

Re: Isolating I/O and other side-effects?

2008-11-24 Thread Bradbev
On Nov 24, 4:44 pm, Rich Hickey <[EMAIL PROTECTED]> wrote: > On Nov 24, 7:22 pm, dokondr <[EMAIL PROTECTED]> wrote: > > > Providing that Clojure is NOT a pure functional language like Haskell, > > yet how can I isolate imperative-style computational structures  from > > the main body of the functi

Re: JMS and Clojure?

2008-11-24 Thread Luc Prefontaine
We use a synchronous layer to JMS queues implemented in Java to hook our Clojure code to the messaging world. Two Java classes to implement a consumer and a producer with some common inheritance are used. We had already some Java implementation so we just beefed it up a bit to make more robust. W

Re: Patch: universal main() with repl/script/compile

2008-11-24 Thread Perry Trolard
I've written a preliminary cljc script -- a shell script for compiling Clojure libs -- against Stephen's patched Clojure (specifically using the clojure.lang.Compile class). Configure the script with the locations of the clojure.jar & clojure- contrib.jar & running cljc w/o options calls clojure.

Re: update a ref struct

2008-11-24 Thread Brian Doyle
Yep, that's just a typo in the email. Something was wrong with my browser and I couldn't just paste the code in :( On Mon, Nov 24, 2008 at 3:33 PM, Shawn Hoover <[EMAIL PROTECTED]>wrote: > On Mon, Nov 24, 2008 at 5:17 PM, Brian Doyle <[EMAIL PROTECTED]>wrote: > >> I am parsing a file and to comp

Re: Adapting a functional pretty-printer to Clojure

2008-11-24 Thread Chouser
On Mon, Nov 24, 2008 at 5:27 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I believe I have fixed all of my stack-space issues except for this > one annoying function (rewritten from the original since the > multimethod wasn't buying me much): > > (defn flatten [x] > (let [type (:type x)]

Re: Patch: universal main() with repl/script/compile

2008-11-24 Thread Perry Trolard
On Nov 24, 4:03 pm, Stuart Sierra <[EMAIL PROTECTED]> wrote: > Hi Perry, Stephen, > I like the "convention over configuration"-ness of defaulting to ./ > classes.  One thought: Weird errors might result if ./classes is not > on classpath.  Is there an easy way to check that, and display a > helpf

Re: Isolating I/O and other side-effects?

2008-11-24 Thread Rich Hickey
On Nov 24, 7:22 pm, dokondr <[EMAIL PROTECTED]> wrote: > Providing that Clojure is NOT a pure functional language like Haskell, > yet how can I isolate imperative-style computational structures from > the main body of the functional program? You can't, other than manually. > How can I ensure

JMS and Clojure?

2008-11-24 Thread falcon
What is the best way of accessing Java Messaging Service though Clojure? Sounds like Rich has already experimented, with good results: >>rhickey: I did some playing (in Clojure) with JMS and OpenMQ and it was >>awesome, easy, fun and vert fast, with pro level docs from Sun (http://clojure-log.n0

Reactive Programming in F# and CELLs

2008-11-24 Thread falcon
I hope folks here don't mind this post. The following article explains how to do reactive programming in F#: http://tomasp.net/blog/reactive-i-fsevents.aspx (the bottom of the article has links to rest of the articles in the series) There has been some recent discussion on CELLs in Clojure. The

Isolating I/O and other side-effects?

2008-11-24 Thread dokondr
Providing that Clojure is NOT a pure functional language like Haskell, yet how can I isolate imperative-style computational structures from the main body of the functional program? How can I ensure referential transparency in Clojure? What I/O primitives Clojure provides? Thanks! --~--~--

Re: Can Clojure functions be anonymous, curried and allow composition?

2008-11-24 Thread Randall R Schulz
On Monday 24 November 2008 15:14, dokondr wrote: > On Nov 25, 2:06 am, Jarkko Oranen <[EMAIL PROTECTED]> wrote: > ... > > > > -- 3) Function composition: > > > Prelude> (f2 . f) 3 > > > 8 > > > Prelude> > > > > 1) (def fn1 (partial + 1)) > > 2) (def fn2 #(* % 2)) or (fn [x] (* x 2))) > > 3) ((comp

Distributed concurrent applications in Clojure?

2008-11-24 Thread dokondr
Any ideas how Clojure can be used for distributed concurrent applications ? To my mind it should be possible to implement in Clojure mechanism similar to Erlang light-weight processes running on distributed 'nodes' that can be addressed by 'ports' to send them 'commands'. How this can be done wit

Re: update a ref struct

2008-11-24 Thread Stuart Halloway
Another possible approach. Key idea here is to use partition to create a sliding window over the lines, plus a sentinel value (I picked "") before the first line. Pretty sure I like partition over reduce for this particular example. (ns examples.convert (:use [clojure.contrib.duck-stre

Re: Can Clojure functions be anonymous, curried and allow composition?

2008-11-24 Thread Matt Moriarity
comp composes functions just like the dot operator On Nov 24, 6:14 pm, dokondr <[EMAIL PROTECTED]> wrote: > On Nov 25, 2:06 am, Jarkko Oranen <[EMAIL PROTECTED]> wrote: > ... > > > > -- 3) Function composition: > > > Prelude> (f2 . f) 3 > > > 8 > > > Prelude> > > > 1) (def fn1 (partial + 1)) > >

Re: Can Clojure functions be anonymous, curried and allow composition?

2008-11-24 Thread dokondr
On Nov 25, 2:06 am, Jarkko Oranen <[EMAIL PROTECTED]> wrote: ... > > -- 3) Function composition: > > Prelude> (f2 . f) 3 > > 8 > > Prelude> > > 1) (def fn1 (partial + 1)) > 2) (def fn2 #(* % 2)) or (fn [x] (* x 2))) > 3) ((comp fn2 fn1) 3) > > -- > Jarkko And what is 'comp'? --~--~-~--~-

Re: Can Clojure functions be anonymous, curried and allow composition?

2008-11-24 Thread Matt Moriarity
1 is actually an example of partial application of functions more than it is currying. Haskell's currying makes partial application far more natural though. In Clojure you can use the (partial ...) macro to do this: user=> (def f (partial + 1)) user=> (f 1) 2 2 is done using the (fn ...) special

Re: update a ref struct

2008-11-24 Thread Kevin Downey
On Mon, Nov 24, 2008 at 2:34 PM, Kevin Downey <[EMAIL PROTECTED]> wrote: > ref-set needs its one set of parens, and the last thing in the ref-set > call needs to be a function either (fn [x] ...) or a symbol for a var > that holds a function I made a mistake here. I was thinking of alter, not ref

Re: Can Clojure functions be anonymous, curried and allow composition?

2008-11-24 Thread Stuart Halloway
>> >> -- 2) Anonymous function: >> Prelude> let f2 = \x -> x * 2 >> Prelude> f2 2 >> 4 > > (def f2 (fn [x] (* x 2))) ; => #'user/f2 > (f2 2); => 4 Or even (def f2 #(* % 2)) Stuart --~--~-~--~~~---~--~~ You received this message because you ar

Re: Can Clojure functions be anonymous, curried and allow composition?

2008-11-24 Thread Jarkko Oranen
On Nov 25, 12:54 am, dokondr <[EMAIL PROTECTED]> wrote: > How can I write the following examples in Clojure that in Haskell will > be: > > --  1) Curried function: > Prelude> let f = (+) 1 > Prelude> f 1 > 2 > > -- 2) Anonymous function: > Prelude> let f2 = \x -> x * 2 > Prelude> f2 2 > 4 > > --

Re: Can Clojure functions be anonymous, curried and allow composition?

2008-11-24 Thread Jeff Rose
dokondr wrote: > How can I write the following examples in Clojure that in Haskell will > be: > > -- 1) Curried function: > Prelude> let f = (+) 1 > Prelude> f 1 > 2 (def f (partial + 1)) ; => #'user/f (f 1) ; => 2 > > -- 2) Anonymous function: > Prelude> let f2 = \x -> x * 2

Re: update a ref struct

2008-11-24 Thread Jeff Rose
For using references in general, here is a little example: [EMAIL PROTECTED]:~$ clj Clojure user=> (def foo (ref 0)) #'user/foo user=> foo # user=> @foo 0 user=> (ref-set foo 1) java.lang.IllegalStateException: No transaction running (NO_SOURCE_FILE:0) user=> (dosync (ref-set foo 1)) 1 user=> @fo

Can Clojure functions be anonymous, curried and allow composition?

2008-11-24 Thread dokondr
How can I write the following examples in Clojure that in Haskell will be: -- 1) Curried function: Prelude> let f = (+) 1 Prelude> f 1 2 -- 2) Anonymous function: Prelude> let f2 = \x -> x * 2 Prelude> f2 2 4 -- 3) Function composition: Prelude> (f2 . f) 3 8 Prelude> --~--~-~--~~-

Re: update a ref struct

2008-11-24 Thread Kevin Downey
ref-set needs its one set of parens, and the last thing in the ref-set call needs to be a function either (fn [x] ...) or a symbol for a var that holds a function On Mon, Nov 24, 2008 at 2:30 PM, Brian Doyle <[EMAIL PROTECTED]> wrote: > Thanks Kevin, I will try using reduce instead. I would like

Re: update a ref struct

2008-11-24 Thread Shawn Hoover
On Mon, Nov 24, 2008 at 5:17 PM, Brian Doyle <[EMAIL PROTECTED]> wrote: > I am parsing a file and to compare the current line > with the previous line of the file. I am using line-seq > to go thru the file and I thought I would create a > ref to store the previous line. When I want to update >

Re: update a ref struct

2008-11-24 Thread Brian Doyle
Thanks Kevin, I will try using reduce instead. I would like to know what I'm doing wrong with updating the ref for future reference. Thanks. On Mon, Nov 24, 2008 at 3:23 PM, Kevin Downey <[EMAIL PROTECTED]> wrote: > > I know you are asking about refs, but you might want to think about > using r

Re: Adapting a functional pretty-printer to Clojure

2008-11-24 Thread [EMAIL PROTECTED]
I believe I have fixed all of my stack-space issues except for this one annoying function (rewritten from the original since the multimethod wasn't buying me much): (defn flatten [x] (let [type (:type x)] (cond (or (= type :NIL) (= type :TEXT)) x (= type :CONCAT)

Re: update a ref struct

2008-11-24 Thread Kevin Downey
I know you are asking about refs, but you might want to think about using reduce to walk the line-seq. the nature of reduce lets you have access to the line-seq, two lines at a time no need for a ref. On Mon, Nov 24, 2008 at 2:17 PM, Brian Doyle <[EMAIL PROTECTED]> wrote: > I am parsing a file an

Re: File Copy

2008-11-24 Thread James G. Sack (jim)
Michael Wood wrote: > On Mon, Nov 24, 2008 at 10:34 PM, James G. Sack (jim) <[EMAIL PROTECTED]> > wrote: > [...] >> ==> FYI add_classpath works fine. >> As a curiosity, I notice that (System/getProperty "java.class.path") >> does not reflect any change after add-classpath. >> ==> I wonder if this

update a ref struct

2008-11-24 Thread Brian Doyle
I am parsing a file and to compare the current line with the previous line of the file. I am using line-seq to go thru the file and I thought I would create a ref to store the previous line. When I want to update the previous line value I can't seem to do it. I've never used refs before so I'm

Re: Patch: universal main() with repl/script/compile

2008-11-24 Thread Stuart Sierra
> On Nov 24, 2008, at 3:31 PM, Perry Trolard wrote: > > Regarding clojure.lang.Compile: this is incredibly handy! Thanks. What > > do think about adding a default value to the clojure.compile.path > > system property (./classes)? On Nov 24, 3:57 pm, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote:

Re: File Copy

2008-11-24 Thread Michael Wood
On Mon, Nov 24, 2008 at 10:34 PM, James G. Sack (jim) <[EMAIL PROTECTED]> wrote: [...] > ==> FYI add_classpath works fine. > As a curiosity, I notice that (System/getProperty "java.class.path") > does not reflect any change after add-classpath. > ==> I wonder if this is as it should be? And if so,

Re: Patch: universal main() with repl/script/compile

2008-11-24 Thread Stephen C. Gilardi
On Nov 24, 2008, at 3:31 PM, Perry Trolard wrote: > Regarding clojure.lang.Compile: this is incredibly handy! Thanks. What > do think about adding a default value to the clojure.compile.path > system property (./classes)? I like it. I'll make that change. There is an underlying default of "cla

Re: Patch: universal main() with repl/script/compile

2008-11-24 Thread Michael Wood
On Mon, Nov 24, 2008 at 9:27 PM, Stephen C. Gilardi <[EMAIL PROTECTED]>wrote: > > On Nov 24, 2008, at 1:49 PM, Michael Wood wrote: > > This looks great :) > > > Thanks! > > A couple of comments below: > > On Mon, Nov 24, 2008 at 6:57 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> > wrote: > [...] > >

new version of the book: Beta 3

2008-11-24 Thread Stuart Halloway
http://blog.thinkrelevance.com/2008/11/24/programming-clojure-beta-3-is-out Thanks again to everybody on this list for all your encouragement and technical help! Cheers, Stuart --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

Re: File Copy

2008-11-24 Thread James G. Sack (jim)
Stuart Sierra wrote: > Ok, first you need to add the commons-io.jar to the Java classpath. > You can do this by editing the Clojure startup script. The argument > to "-cp" is a colon-separated list of directories and/or JAR files to > go on the classpath. So if the command line was this: > >

Norvig's Spelling Corrector in Clojure

2008-11-24 Thread Brian Adkins
I emailed Peter Norvig about Rich's Clojure version of his spelling corrector. He graciously added an entry to the web page. Clojure does quite well for this program. It's very nice aesthetically, and it's the shortest so far. In fact, I noticed the sort order of the entries has changed from LOC (

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

2008-11-24 Thread James G. Sack (jim)
San Diego, CA USA ..jim --~--~-~--~~~---~--~~ 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 To unsubscribe from this group, send email to [EMAIL PROTECTED]

Re: Patch: universal main() with repl/script/compile

2008-11-24 Thread Perry Trolard
Very cool. The two main use cases work well (REPL, script), & the others -- loaded files, evaluation -- are real bonuses. (It's also really nice to have an extensible REPL implemented in Clojure). I think a flag for file loading (-l, --load) to make clear the distinction b/w the file that's a scr

Re: Slightly off-topic: building DSLs incrementally in Java

2008-11-24 Thread Dave Newton
--- On Mon, 11/24/08, Stuart Sierra wrote: > An interesting idea: hacking the Java compiler to perform > source-code transformations: > http://www.iam.unibe.ch/~akuhn/blog/2008/11/roman-numerals-in-your-java/ That's pretty cool, but not really a new idea--the JastAdd [1] and Polyglot [2] compile

Re: Patch: universal main() with repl/script/compile

2008-11-24 Thread Stephen C. Gilardi
On Nov 24, 2008, at 2:28 PM, Stephen C. Gilardi wrote: >> Usage: java -jar clojure.jar [option*] [file-arg*] [-- [arg*]] > > That looks exactly right to me. I'll be adopting that. On further review, I think this is better: Usage: java -jar clojure.jar [option*] [file-arg*] [-- arg*] M

Re: Patch: universal main() with repl/script/compile

2008-11-24 Thread Stephen C. Gilardi
On Nov 24, 2008, at 2:17 PM, J. McConnell wrote: > > On Mon, Nov 24, 2008 at 1:49 PM, Michael Wood <[EMAIL PROTECTED]> > wrote: >> >> This looks great :) > > Yes, it does! :-) > > I was going to suggest something similar: > > Usage: java -jar clojure.jar [option*] [file-arg*] [-- [arg*]] Tha

Re: Patch: universal main() with repl/script/compile

2008-11-24 Thread Stephen C. Gilardi
On Nov 24, 2008, at 1:49 PM, Michael Wood wrote: > This looks great :) Thanks! > A couple of comments below: > > On Mon, Nov 24, 2008 at 6:57 PM, Stephen C. Gilardi > <[EMAIL PROTECTED]> wrote: > [...] >> Here are some examples of using the proposed clojure.main via "java - >> jar clojure.jar

Re: Patch: universal main() with repl/script/compile

2008-11-24 Thread J. McConnell
On Mon, Nov 24, 2008 at 1:49 PM, Michael Wood <[EMAIL PROTECTED]> wrote: > > This looks great :) Yes, it does! > On Mon, Nov 24, 2008 at 6:57 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote: > [...] > > Here are some examples of using the proposed clojure.main via "java - > > jar clojure.jar":

Slightly off-topic: building DSLs incrementally in Java

2008-11-24 Thread Stuart Sierra
An interesting idea: hacking the Java compiler to perform source-code transformations: http://www.iam.unibe.ch/~akuhn/blog/2008/11/roman-numerals-in-your-java/ Based on ideas in Smalltalk: http://smallwiki.unibe.ch/diesel/ -Stuart Sierra --~--~-~--~~~---~--~~ You

Re: Patch: universal main() with repl/script/compile

2008-11-24 Thread Michael Wood
This looks great :) A couple of comments below: On Mon, Nov 24, 2008 at 6:57 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote: [...] > Here are some examples of using the proposed clojure.main via "java - > jar clojure.jar": > > Display usage info: > > % java -jar clojure.jar --help > Usage: jav

Help needed: Clojure wikibook is desperately in need of cleanup!

2008-11-24 Thread Jarkko Oranen
The Clojure wikibook has accumulated a lot of useful information over time, but it's really getting too big to be just one page. It has no organisation to speak of and it's even unclear what version of Clojure is required for each example! For starters, I created some subpages for the larger topi

Re: Stubbing macro for isolated unit tests

2008-11-24 Thread Justin Giancola
On Nov 23, 9:56 pm, James Reeves <[EMAIL PROTECTED]> wrote: > On Nov 23, 11:58 pm, Justin Giancola <[EMAIL PROTECTED]> > wrote: > > > Neat. I noticed that you're forcing the arg lists into vectors in both > > make-maps and in stubfn. Since they're not being manipulated at all, > > you could just a

Re: Observations and questions regarding long-running, adaptable, transparent software

2008-11-24 Thread Randall R Schulz
On Thursday 18 September 2008 15:28, falcon wrote: > Looks like the FrTime dissertation was published this year: > > Integrating Dataflow Evaluation into a Practical Higher-Order > Call-by- Value Language > By Gregory Cooper > > http://dl.lib.brown.edu/pdfs/etd67.20080429180432.pdf This document

Re: seq and vector

2008-11-24 Thread [EMAIL PROTECTED]
On Nov 24, 3:03 pm, Rich Hickey <[EMAIL PROTECTED]> wrote:> > Speculating about inefficiency without a concrete counter-proposal is > not productive. While there could no doubt be some higher-performance > vector constructor/reducers, producing vector-returning versions of > the sequence ops is no

Re: Patch: universal main() with repl/script/compile

2008-11-24 Thread Stephen C. Gilardi
On Nov 23, 2008, at 2:30 PM, Stuart Sierra wrote: > Hmm, you mean write the REPL in Clojure? I hadn't though of that. > Intriguing idea. It would be neat if the REPL were just a function, > so you could start it from within a program using arbitrary input/ > output streams. Something to think

Re: Clojure Box, alpha

2008-11-24 Thread Shawn Hoover
On Mon, Nov 24, 2008 at 9:50 AM, mosi <[EMAIL PROTECTED]> wrote: > > Hi, > thank you in the name of all noobz who, like me, just want to have a > quick ride with closure. > The installation worked almost perfectly. > The dialog window: outside Emacs, waiting for connection to server ... > (swank)

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

2008-11-24 Thread Peter Wolf
Boston MA --~--~-~--~~~---~--~~ 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 To unsubscribe from this group, send email to [EMAIL PROTECTED] For more optio

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

2008-11-24 Thread Adrian Cuthbertson
Johannesburg, South Africa. --~--~-~--~~~---~--~~ 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 To unsubscribe from this group, send email to [EMAIL PROTECTED

Running Clojure on Pocket PC

2008-11-24 Thread dokondr
Any ideas if resources of Pocket PC (Windows Mobile 2.0) will suffice to run single-threaded Clojure app? What JVM for Pocket PC will do the job? What porting efforts will be required, if any? Thanks! --~--~-~--~~~---~--~~ You received this message because you are

Running Clojure on Pocket PC

2008-11-24 Thread dokondr
Any ideas if resources of Pocket PC (Windows Mobile 2.0) will suffice to run single-threaded Clojure app? What JVM for Pocket PC will do the job? What porting efforts will be required, if any? Thanks! --~--~-~--~~~---~--~~ You received this message because you are

Re: Clojure Box, alpha

2008-11-24 Thread mosi
Hi, thank you in the name of all noobz who, like me, just want to have a quick ride with closure. The installation worked almost perfectly. The dialog window: outside Emacs, waiting for connection to server ... (swank) didn`t finish. The result: no response from server. What is the purpose of the

Re: Exception reporting

2008-11-24 Thread Michael Wood
On Mon, Nov 24, 2008 at 4:45 PM, Stuart Sierra <[EMAIL PROTECTED]> wrote: > > If you're running this at the REPL, in recent versions only the name > of the exception is printed. If you want the full backtrace, do: > (.printStackTrace *e) That doesn't explain why the line number is listed as 0.

Re: Poll: Which clojure.contrib libs should be bundled with Clojure?

2008-11-24 Thread Chouser
This just a quick reminder about the poll. We've got 22 responses, but I'm sure there are more than 22 opinionated Clojuristas on this list. I'll summarize the results in a couple days, so vote now if you care. Vote here: https://spreadsheets.google.com/viewform?key=p1hkQs__fVyaQGEP_bOFRVQ --C

Re: learning clojure

2008-11-24 Thread Stuart Sierra
It's useful to know the standard Java libraries, especially for File/ IO stuff. You can pick up nearly all of it from the Sun Java tutorials: http://java.sun.com/docs/books/tutorial/ -Stuart Sierra On Nov 23, 11:34 pm, syamajala <[EMAIL PROTECTED]> wrote: > How easy is it to pick up clojure wi

Re: Exception reporting

2008-11-24 Thread Stuart Sierra
If you're running this at the REPL, in recent versions only the name of the exception is printed. If you want the full backtrace, do: (.printStackTrace *e) -Stuart Sierra On Nov 24, 2:39 am, Timothy Pratley <[EMAIL PROTECTED]> wrote: > If you put the following into a file and run it: > > (defn

Re: File Copy

2008-11-24 Thread Stuart Sierra
Ok, first you need to add the commons-io.jar to the Java classpath. You can do this by editing the Clojure startup script. The argument to "-cp" is a colon-separated list of directories and/or JAR files to go on the classpath. So if the command line was this: java -cp /path/to/clojure.jar c

Re: Keyword constraints not enforced

2008-11-24 Thread Rich Hickey
On Nov 23, 9:09 am, James Reeves <[EMAIL PROTECTED]> wrote: > On Nov 23, 11:38 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > Hi, > > > According tohttp://clojure.org/reader: > > > > Keywords are like symbols, except: > > > > o They can and must begin with a colon, e.g. :fre

Re: seq and vector

2008-11-24 Thread Rich Hickey
On Nov 24, 2:41 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Nov 24, 12:41 am, "Kevin Downey" <[EMAIL PROTECTED]> wrote: > > > I don't think you understand. clojure data structures are IMMUTABLE. > > every call to conj, or anyother function returns a "new" object. To > > optimize ther

Re: Typo on http://clojure.org/jvm_hosted

2008-11-24 Thread Michael Wood
On Mon, Nov 24, 2008 at 7:24 AM, JonathanMeeks <[EMAIL PROTECTED]> wrote: > > If this is the incorrect forum to post this please point me in the > correct direction... > > On http://clojure.org/jvm_hosted > > The celsius defn has a doto with incorrect syntax. Shouldn't > > (doto frame >

Re: French translation of the Clojure rationale

2008-11-24 Thread budu
Wow, jamais je n'aurais pensé lire des commentaires à propos des problèmes de prononciation de madame Marois ce matin. Comme on dit au Québec: "Osti qu'j'ai hâte qu'les élections finisse!" Sorry about being offtopic ;-) On Nov 22, 11:35 am, Luc Prefontaine <[EMAIL PROTECTED]> wrote: > Salutation

Re: learning clojure

2008-11-24 Thread Vincent Foley
As somebody who did only a few hours of Java, but knows object oriented programming well and had its fair share of fun with Common Lisp, Scheme and Haskell, Clojure was quite easy to pick up. For all pure Clojure stuff, I don't think that you need to know anything about Java. When you work with

Re: File Copy

2008-11-24 Thread James G. Sack (jim)
Parth Malwankar wrote: > > > On Nov 24, 12:34 am, Stuart Sierra <[EMAIL PROTECTED]> > wrote: >> Honestly, for this kind of low-level stuff I always use the Apache >> Commons libraries, , esp. the Lang and IO >> components. They've got every imaginable stream function

Typo on http://clojure.org/jvm_hosted

2008-11-24 Thread JonathanMeeks
If this is the incorrect forum to post this please point me in the correct direction... On http://clojure.org/jvm_hosted The celsius defn has a doto with incorrect syntax. Shouldn't (doto frame (setLayout (new GridLayout 2 2 3 3)) ...) be (doto frame

learning clojure

2008-11-24 Thread syamajala
How easy is it to pick up clojure without having any previous java experience? I have plenty of common lisp experience, but have just never bothered learning java. I recently got a chance to watch the boston lisp talk on clojure, and it looks fairly straightforward, but I feel that not having any

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

2008-11-24 Thread Ed Bowler
Sheffield, UK --~--~-~--~~~---~--~~ 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 To unsubscribe from this group, send email to [EMAIL PROTECTED] For more op

Re: one way to write a factorial function

2008-11-24 Thread prhlava
user=> (= (range 10) (for [x (range 10)] x)) true :-) Vlad --~--~-~--~~~---~--~~ 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 To unsubscribe from this gro

Re: one way to write a factorial function

2008-11-24 Thread prhlava
> Help me understand why this isn't written > > (defn factorial [n] >   (apply * (range 1 (+ n 1))) > > instead. That is, I don't get the purpose of the for statement. Neither do I now ;-), nice, Vlad --~--~-~--~~~---~--~~ You received this message because you a

Re: No complex numbers?

2008-11-24 Thread Konrad Hinsen
On 23.11.2008, at 16:28, Rock wrote: > Furthermore, the implementation should, I think, be generic, that > is, we should be capable of creating complex numbers, the real and > imaginary parts of which can be integers, rationals, or reals. For > instance, it sould be possible to > do this: >