Re: Why does using a dynamic binding make a function impure?

2010-07-19 Thread Paul Moore
On 19 July 2010 19:41, Laurent PETIT laurent.pe...@gmail.com wrote: 2010/7/19 Stuart Halloway stuart.hallo...@gmail.com use =  rely on In your example, func relies on a variable which is (presumably, based on its use in other-func) intended for dynamic binding. Therefore, func is impure.

Re: clojure.contrib.sql does not protect table names?

2010-07-14 Thread Paul Moore
On 14 July 2010 16:21, Tim McCormack basalgang...@brainonfire.net wrote: Is there some kind of JDBC nonsense that I'm not aware of? Are backticks a special feature of MySQL that can't be read by all JDBC- compatible RDBMSs? I'm not a database person, but it seems to me that either backticks

Re: ClojureDocs.org

2010-07-13 Thread Paul Moore
On 12 July 2010 23:25, j-g-faustus johannes.fries...@gmail.com wrote: The site looks very nice, I especially like the find real world examples functionality and the fact that it collects documentation for common non-core libraries as well. I made my own cheat sheet for private use over the

Re: Idiomatic Clojure namespace names

2010-07-10 Thread Paul Moore
On 10 July 2010 09:06, James Reeves jree...@weavejester.com wrote: On 9 July 2010 17:46, Paul Moore p.f.mo...@gmail.com wrote: Is there any benefit to using a name like foo.core (or foo.api) rather than simply foo (beyond sytlistic considerations, that is)? Clojure compiles foo to a package

Re: Idiomatic Clojure namespace names

2010-07-09 Thread Paul Moore
On 9 July 2010 17:30, Laurent PETIT laurent.pe...@gmail.com wrote: Indeed, foo.api sounds better than foo.core to me, now than I'm exposed to that (core sounds more like 'internals'). But still I prefer to have the library name at the end of the namespace, it's easier to spot than in the

Re: -- macro proposal

2010-07-06 Thread Paul Moore
On 6 July 2010 22:02, Greg g...@kinostudios.com wrote: Greg you're enthusiasm is appreciated. But this ML is filled with talented and smart people who have an equal grasp of logic and reason who have been using Clojure for a couple years now and they aren't clamoring to your nice snippet of

Re: -- macro proposal

2010-07-06 Thread Paul Moore
On 6 July 2010 22:24, Greg g...@kinostudios.com wrote: This would be most likely java interop, ie. -. There the main arguments are 99% of the times the first or the last ones. So - or - will work OK, so what happens when one of the functions takes it in the front, and the other in the

Re: Documentation and examples (and where is the documentation on reduce)?

2010-07-02 Thread Paul Moore
On 2 July 2010 15:50, Meikel Brandmeyer m...@kotka.de wrote: Then there are examples like this one: (reduce '* '(1 2 3)) Someone who is new to Clojure and tries to understand reduce... Does he understand why the result is 3? A result which relies on a not very well-known fact, that you can

Managing the classpath

2010-07-01 Thread Paul Moore
First, a disclaimer - I don't have any problem with the idea of the classpath in Java. In principle, it's pretty similar to Python's sys.path. And jar files are much like Python having zip files on sys.path. So I'm familiar with the idea. Where I struggle is with the practicalities of managing

Re: Managing the classpath

2010-07-01 Thread Paul Moore
On 1 July 2010 15:29, Laurent PETIT laurent.pe...@gmail.com wrote: Hello, note that with java 6 you can specify at once to add all the jars located in a directory: java -cp libs/* clojure.main and you can place any jar you want in directory libs. and this is composable: java -cp

Re: Managing the classpath

2010-07-01 Thread Paul Moore
On 1 July 2010 16:49, Kevin Livingston kevinlivingston.pub...@gmail.com wrote: Some of the build tools like Maven can help a lot. (Thanks for your other comments, which I've cut. But this one made me think). I've heard comments like this elsewhere (with regard to both Maven and Leiningen), but

Re: Clojure's n00b attraction problem

2010-06-30 Thread Paul Moore
On 30 June 2010 04:02, Jason Smith ja...@lilypepper.com wrote: So I'll say it again, it's just not that simple.  Unless you already know Java, and the only learning curve you face is the new features in Clojure.  Then it's not bad. But it does give you new ways to cut your foot off more

Re: Clojure's n00b attraction problem

2010-06-30 Thread Paul Moore
On 29 June 2010 23:31, Sean Corfield seancorfi...@gmail.com wrote: FWIW, I blogged a short step-by-step post on getting up and running with Leiningen to show some Clojure at the repl, run as a script and compiled to a JAR and run via java:

Re: Newb Question

2010-06-29 Thread Paul Moore
On 28 June 2010 20:24, Angel Java Lopez ajlopez2...@gmail.com wrote: Hi people! Any way to produce a lazy seq of chars, that prints as a string, based on two parameters, n (number of repeats), text (text to repeat)? Then, something like (myrepeat 100 superdupertext) could be

Re: Clojure's n00b attraction problem

2010-06-29 Thread Paul Moore
On 28 June 2010 19:49, Mike Meyer mwm-keyword-googlegroups.620...@mired.org wrote: Yet another set of choices n00bs are faced with is figuring out how to actually compile their source into an executable. Executable? We're talking about Java here. It doesn't do executables - it does jar files.

Re: Life on the bleeding edge

2010-06-29 Thread Paul Moore
On 29 June 2010 06:47, Mark Engelberg mark.engelb...@gmail.com wrote: Yes, that is disconcerting that clojure-contrib produces errors on Windows (sigh, it often feels like Windows is a second-class citizen when it comes to clojure), but that did the trick and allowed the build to complete.  

Re: Clojure's n00b attraction problem

2010-06-29 Thread Paul Moore
On 28 June 2010 23:13, Lee Spector lspec...@hampshire.edu wrote: and more recently I had to figure out about.dotted.names and their meaning with respect to directory structures, in order to get require to find a second clj file. It's not complicated, but it's also not obvious to everyone

Re: Clojure's n00b attraction problem

2010-06-29 Thread Paul Moore
On 28 June 2010 22:41, cageface milese...@gmail.com wrote: On Jun 28, 12:16 pm, Martin DeMello martindeme...@gmail.com wrote: It depends. I found the concepts pretty easy, since I have done a lot of functional programming, but when I was new to clojure I had a truly horrible time figuring out

Re: Clojure's n00b attraction problem

2010-06-29 Thread Paul Moore
On 29 June 2010 06:11, cageface milese...@gmail.com wrote: On Jun 28, 9:14 pm, Michael Richter ttmrich...@gmail.com wrote: Ah.  The Clojure community has already started down the road to Common Lisp-style, smugness-generated obscurity and disdain.  Bravo!  Well-played! Not at all. Nothing

Re: Newb Question

2010-06-29 Thread Paul Moore
On 29 June 2010 15:14, Angel Java Lopez ajlopez2...@gmail.com wrote: Hi people! Paul, yes! but... The apply and str evaluations in (apply str (repeat n text)) are lazy? I guess the result could be a big string.  Isn't it? So you're looking for a result that behaves like a string, but

Re: Life on the bleeding edge

2010-06-29 Thread Paul Moore
On 29 June 2010 18:36, Mark Engelberg mark.engelb...@gmail.com wrote: On Tue, Jun 29, 2010 at 12:30 AM, Paul Moore p.f.mo...@gmail.com wrote: Is there anything a clojure newbie with little JVM development experience (but a willingness to learn) can do to help with the Windows situation? From

Re: Leiningen documentation review?

2010-06-29 Thread Paul Moore
On 29 June 2010 21:03, Phil Hagelberg p...@hagelb.org wrote: On Wed, Jun 16, 2010 at 9:24 PM, Phil Hagelberg p...@hagelb.org wrote: Mostly I'd like feedback on the tutorial: http://github.com/technomancy/leiningen/blob/master/TUTORIAL.md But if you've got some time to look over the readme,

Re: Batch file wrappers on Windows

2010-06-22 Thread Paul Moore
On 21 June 2010 22:12, Russ Olsen russol...@gmail.com wrote: Paul, One way would be to use the cljw.exe that comes with dejour. This is a windows executable that runs clojure without creating that annoying extra window. Thanks. That's certainly one option - I could probably without too much

Re: Batch file wrappers on Windows

2010-06-22 Thread Paul Moore
On 22 June 2010 00:11, Rick Moynihan rick.moyni...@gmail.com wrote: On 21 June 2010 18:42, Paul Moore p.f.mo...@gmail.com wrote: 3. Using a bat file to start a GUI application from Explorer causes an unnecessary and ugly console window to appear. You should use javaw instead of java to start

Re: Batch file wrappers on Windows

2010-06-22 Thread Paul Moore
On 22 June 2010 15:15, Lars Nilsson chamael...@gmail.com wrote: Maybe Windows Script Host is an option, if you haven't looked at that one yet. Yes, WSH/VBS is a reasonable option. There are some gotchas which you need to be careful of though - there's *still* only one filetype (.vbs) which is

Batch file wrappers on Windows

2010-06-21 Thread Paul Moore
The common way of running Java applications (and hence Clojure code) on Windows seems to be to use a batch file wrapper (for example, lein.bat for Leiningen). It seems to me that there are a number of issues with this: 1. Batch files don't nest well - if I want to call lein.bat from within

Re: Basic toolset for non-Java programmer

2010-06-19 Thread Paul Moore
Thanks to Ryan, Rob and Alex for the suggestions. I'll have a deeper look into all of them. Paul -- 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 script in the classpath

2010-06-19 Thread Paul Moore
On 19 June 2010 07:24, rzeze...@gmail.com rzeze...@gmail.com wrote: On Jun 18, 6:15 pm, Paul Moore p.f.mo...@gmail.com wrote: I've just seen a couple of postings which, if I'm not mistaken, imply that it's possible to have a Clojure script in my classspath. Is that right? Yes, you can have

Re: Clojure script in the classpath

2010-06-19 Thread Paul Moore
On 19 June 2010 17:22, Chas Emerick cemer...@snowtide.com wrote: If you're just looking to run a script that happens to be on the classpath, you can do so by prepending an '@' character to the classpath-relative path to the script. So, if a directory foo is on your classpath, and a clojure

Re: Enhanced Primitive Support

2010-06-18 Thread Paul Moore
On 18 June 2010 15:08, Stuart Halloway stuart.hallo...@gmail.com wrote: While I enjoy a theoretical debate as much as the next person, it would be nice to see (1) examples of real code that fail on reasonable inputs, if this change were made. And how difficult it would be to fix them. (2)

Basic toolset for non-Java programmer

2010-06-18 Thread Paul Moore
I'm wondering, what would be a useful basic set of tools for a newcomer to Clojure with no Java background? I'm not really talking about IDEs (everyone has their own opinions about IDEs, and I've seen some discussions elsewhere to give me some pointers on that one). I'm more interested in things

java -server

2010-06-03 Thread Paul Moore
More of a Java question than a Clojure one, but it's in the context of clojure, and I don't know a better place to ask, so forgive me... I've seen a couple of references in articles about clojure to using java -server. My java executable has a server option, but when I try it, I get told:

Re: java -server

2010-06-03 Thread Paul Moore
On 3 June 2010 21:25, Aaron Cohen aa...@assonance.org wrote: This error indicates that your java executable is coming from the JRE rather than the JDK. On windows, the JRE only includes the client virtual machine. If you have the JDK already installed on your computer, switch your JAVA_HOME

Re: Multithreading didn't make my program as much faster as I expected...

2010-05-31 Thread Paul Moore
On 31 May 2010 06:12, Zak Wilson zak.wil...@gmail.com wrote: The trouble with pmap is that it only works well with a slow function and a short sequence. In trivial tests, it seems to be best if the sequence has as many elements as you do cores. I've been experimenting with things that are

Re: Clojure script with shebangoid on windows

2010-05-31 Thread Paul Moore
On 31 May 2010 07:48, alux alu...@googlemail.com wrote: Hello Glen, good hint. Problem and solution reproduced ;-) Yes, it looks like Clojure's (comment ...) form requires the contents of the comment to be syntactically correct Clojure forms. As Glen says, forward slashes seem to work - although

Re: Clojure script with shebangoid on windows

2010-05-30 Thread Paul Moore
On 30 May 2010 12:31, alux alu...@googlemail.com wrote: Small addition, you missed to add the : before eof replace goto eof by goto :eof Thanks, good catch. (goto eof without the colon works on TCC, which I normally use as my command shell). Paul. -- You received this message because you

Multithreading didn't make my program as much faster as I expected...

2010-05-30 Thread Paul Moore
I've written a small simulation program, in order to help me learn Clojure. I've reproduced it below. It's quite likely not very idiomatic - any suggestions on how to improve it would be nice. However, my main concern is that it doesn't seem to scale as I would expect when multi-threading. The

Re: Clojure script with shebangoid on windows

2010-05-28 Thread Paul Moore
On 28 May 2010 09:48, alux alu...@googlemail.com wrote: Hello! Short: It works, but is not perfect. (this may need an windows expert to make it better) Try this: --- myscript.bat --- :x (comment @echo off java -cp clojure.jar clojure.main %~f0 %* goto eof ) (println Hi!

Re: Clojure script with shebangoid on windows

2010-05-28 Thread Paul Moore
On 28 May 2010 16:17, alux alu...@googlemail.com wrote: Hello Paul, thats much better, many thanks! I've added it to the Wikibooks page, http://en.wikibooks.org/wiki/Clojure_Programming/Tutorials_and_Tips#Shebang_Scripting_in_Clojure Paul. -- You received this message because you are

Newbie (with no Java experience) - how best to learn?

2010-05-27 Thread Paul Moore
Hi, I'm new to Clojure, and looking for the best way to get going. I've got a pretty broad experience of various programming languages (C, Python, Lua, Factor, JavaScript, Haskell, Perl, ...) including a bit of experience with Lisp-like languages, so the language itself isn't likely to be a huge

Re: Newbie (with no Java experience) - how best to learn?

2010-05-27 Thread Paul Moore
On 27 May 2010 15:16, Sean Devlin francoisdev...@gmail.com wrote: Welcome aboard Paul! Thanks! 1.  Pick an IDE and stick with it.  I'd recommend ClojureBox if you're interested in Clojure only, or NetBeans + Enclojure if you want to learn some about Java too.  In fact, NetBeans is probably a

Re: Newbie (with no Java experience) - how best to learn?

2010-05-27 Thread Paul Moore
On 27 May 2010 15:38, Base basselh...@gmail.com wrote: Regarding Clojure I got Stuart Halloway's book Programming Clojure Another recommendation! Looks like that's definite then :-) Thanks. Also, I spend a *lot* of time on this site and ask a lot of really dumb questions.  Clojure has the

Re: Newbie (with no Java experience) - how best to learn?

2010-05-27 Thread Paul Moore
On 27 May 2010 16:39, eyeris drewpvo...@gmail.com wrote: The Full Disclojure video series is targeted more toward the lisp newbie, but it contains a series of videos touring different development environments. http://vimeo.com/channels/fulldisclojure Ta. Any way of downloading these to watch

Re: Newbie (with no Java experience) - how best to learn?

2010-05-27 Thread Paul Moore
On 27 May 2010 18:26, Sean Devlin francoisdev...@gmail.com wrote: I make them available CC BY-NC-SA, so download away.  You'll need a vimeo account (free) to download them, though. Ah, I hadn't realised that signing up got a download option. Thanks! Paul. -- You received this message because

Mersenne Twister

2010-05-27 Thread Paul Moore
I want to write a reasonably high-performance simulation program in Clojure. For the random numbers, I'd prefer to use Mersenne Twister (for a number of reasons - it's a well-known, good RNG, and it's commonly used in a number of other languages I use, so it's a good baseline for comparing