Re: Swank, ELPA and Emacs version do you use?

2010-03-20 Thread alux
Okay. So I switched to version 23.1. that had already been installed. AFAIK it uses all the things I installed the last days. Or do I have to update some other stuff? Thank you for the hints, alux Phil Hagelberg schrieb: > On Sat, Mar 20, 2010 at 12:46 PM, alux wrote: > > As far as I understand,

Re: Sequential vs. "divide and conquer" algorithm

2010-03-20 Thread Matt
Throwing in my 2 cents: (def chunk-size 2000) (defn sum-tree-part [nums start length] (reduce #(+ %1 (nth nums (+ start %2))) 0 (range length))) (defn sum-partition[nums] (reduce + (pmap #(sum-tree-part nums % chunk-size) (range 0 (count nums) chunk-size ; Save the

Re: Maven clojure:repl

2010-03-20 Thread Brian Schlining
> > I'm just go through the Incanter getting-started > http://data-sorcery.org/2009/12/20/getting-started/ > > There I find, that I can use > > mvn clojure:repl > > I dont know where to search for a solution, so I ask here. > > There's a pom.xml that works at http://hohonuuli.blogspot.com/2010/01/m

Re: Swank, ELPA and Emacs version do you use?

2010-03-20 Thread Phil Hagelberg
On Sat, Mar 20, 2010 at 12:46 PM, alux wrote: > As far as I understand, the Emacs init files dont support the usage of > different EMacs versions. So which Emacs version do you use? You can use Emacs 22, but since it's pretty old not very many people use it, so the Clojure support for it is not v

Re: Swank, ELPA and Emacs version do you use?

2010-03-20 Thread Tim Johnson
* alux [100320 11:59]: > Sorry to have so many questions. > > I lookes at swank at github, it says it supports Emacs 23 and up; and > I should use ELPA to install it. > > The ELPA install page, explains how to install stuff for Emacs 21 and > 22. > > As far as I understand, the Emacs init files

Re: Swank, ELPA and Emacs version do you use?

2010-03-20 Thread Seth
M-x version GNU Emacs 23.1.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54) of 2009-08-16 on black.local Most of my configuration comes from the Emacs Stater Kit: http://github.com/technomancy/emacs-starter-kit On Mar 20, 3:46 pm, alux wrote: > Sorry to have so many questions. > > I lookes at

Re: clojure.walk

2010-03-20 Thread cej38
I discussed prewalk and postwalk with a another Clojure user that I am friends with. He sent me the following, via email, this morning: I have a workaround/solution for you.I still don't know exactly why, but the :else clause in walk calls outer on form. This will give you all sorts of class

Re: Maven clojure:repl

2010-03-20 Thread alux
Hi Mark, sound plausible. But what should I do now? If there is any way to tell maven what it should use, I'd be happy. Preferred in settings.xml, so i can use it in every project. Thank you, alux Mark Derricutt schrieb: > If this was a fresh project with no plugins defined, maven would look in

Swank, ELPA and Emacs version do you use?

2010-03-20 Thread alux
Sorry to have so many questions. I lookes at swank at github, it says it supports Emacs 23 and up; and I should use ELPA to install it. The ELPA install page, explains how to install stuff for Emacs 21 and 22. As far as I understand, the Emacs init files dont support the usage of different EMacs

Re: Maven clojure:repl

2010-03-20 Thread Mark Derricutt
If this was a fresh project with no plugins defined, maven would look in the default group, for either clojure-maven-plugin or maven-clojure-plugin. -- Pull me down under... On Sun, Mar 21, 2010 at 7:09 AM, liebke wrote: > The Clojure Maven plugin should be called clojure-maven-plugin, not > m

Re: Maven clojure:repl

2010-03-20 Thread alux
But even if I delete it, and do mvn -o clojure:swank I get the same error. Black maven magic. ;-( Regards, a. alux schrieb: > deleting it doesnt help, it seems to be reloaded when I run > clojure:swank > > a. > > > > alux schrieb: > > So, I found a file: > > > > %repo%\org\apache\maven\plugins

Re: Maven clojure:repl

2010-03-20 Thread alux
deleting it doesnt help, it seems to be reloaded when I run clojure:swank a. alux schrieb: > So, I found a file: > > %repo%\org\apache\maven\plugins\maven-clojure-plugin\maven-metadata- > central.xml > > containing > > > > org.apache.maven.plugins > maven-clojure-plugin > > > No, I dont

Re: Maven clojure:repl

2010-03-20 Thread alux
So, I found a file: %repo%\org\apache\maven\plugins\maven-clojure-plugin\maven-metadata- central.xml containing org.apache.maven.plugins maven-clojure-plugin No, I dont know where it comes from. a. alux schrieb: > Hm. > > It cant be an incanter problem. In an empty directory, I get:

Re: Maven clojure:repl

2010-03-20 Thread liebke
When I'm having inexplicable Maven problems, I rm ~/.m2/* and then mvn install again. Good luck, David On Mar 20, 2:27 pm, alux wrote: > Hm. > > It cant be an incanter problem. In an empty directory, I get: > > D:\projekts\test>mvn clojure:swank > [INFO] Scanning for projects... > [INFO] Search

Re: clojure naming convention for accessors vs. local variables

2010-03-20 Thread cageface
So will deftype/protocol be the recommended, idiomatic way to implement ADTs in Clojure 1.2? Will the current map/struct based approaches essentially be deprecated? The doc here http://www.assembla.com/wiki/show/clojure/Datatypes suggested to me that they were more for interfacing with Java in a m

Re: Maven clojure:repl

2010-03-20 Thread alux
Hm. It cant be an incanter problem. In an empty directory, I get: D:\projekts\test>mvn clojure:swank [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'clojure'. [INFO] [ERROR] BUILD ERROR [

Re: Maven clojure:repl

2010-03-20 Thread alux
Um, thats been copy and paste, yes. (side remark, I read on about the plugin, and now I installed the needed swank file too) Thanks and greetings, alux liebke schrieb: > Ah, you're right, only the bin/swank script calls maven the clj and > clj.bat scripts are stand-alone, I thought I had changed

Re: Maven clojure:repl

2010-03-20 Thread liebke
Ah, you're right, only the bin/swank script calls maven the clj and clj.bat scripts are stand-alone, I thought I had changed them (but it's better that they're stand-alone). Was the following the actual error? > [ERROR] BUILD ERROR > [INFO] > --

Re: Maven clojure:repl

2010-03-20 Thread alux
Ah, hello David ;-) Thanks for the quick answer. The script, at least the windows one (and as far as I understand the linux one too) is standalone, without maven. It worked, but I was stuck some steps later when I tried to start the swank server - there is a linux script only. Trying to start sw

Re: Maven clojure:repl

2010-03-20 Thread liebke
There are two solutions to your problem, 1) use the bin/clj script which calls mvn clojure:repl from the modules/incanter-app directory, or 2) just cd to the modules/incanter-app directory and then run mvn clojure:repl your self. That was described in the post you linked to, but it's easy to miss.

Re: Sequential vs. "divide and conquer" algorithm

2010-03-20 Thread Andrzej
On Sat, Mar 20, 2010 at 5:43 PM, Michał Marczyk wrote: > Well, you're calling subvec about twice as many times (I guess) as > there are elements in your input vector. Then you're calling count at > least once for each of the intermediate vectors (and twice for those > which will be split further).

Re: clojure naming convention for accessors vs. local variables

2010-03-20 Thread Stuart Halloway
This will change in Clojure 1.2, with defstruct superseded by deftype, and with capitalization for defprotocols and deftypes. You might want to compare this Clojure example: http://github.com/relevance/labrepl/blob/master/src/solutions/rock_paper_scissors.clj to the OO solutions at http://w

Re: For loop question

2010-03-20 Thread David Nolen
On Sat, Mar 20, 2010 at 8:05 AM, WoodHacker wrote: > When I run the following: > >(for [y (range 4)] (for [x (range 4)] (println x y))) > > I get what I expect - 0 0, 1 0, 2 0, 3 0 etc., but at the end of > each y loop I also get 4 nils. > > ((0 0 > 1 0 > 2 0 > 3 0 > nil nil nil nil) (0 1 >

Re: clojure naming convention for accessors vs. local variables

2010-03-20 Thread David Nolen
On Sat, Mar 20, 2010 at 11:03 AM, strattonbrazil wrote: > Well, even in this case how do lisp programmers typically name their > structs vs their variables? In java I could make an "Employee" class > and then an "employee" object and it was easy to distinguish between > the two. If it's not kosh

Re: Maven clojure:repl

2010-03-20 Thread alux
Hm. Wer lesen kann, ist klar im Vorteil ;-) Well, so I hope there is THE plugin, and not some plugins, and try the first google shows: git clone git://github.com/talios/clojure-maven-plugin cd clojure-maven-plugin mvn install back to incanter, try again. Still the same. Sad, I had hope thats

Re: separating ui and content in clojure

2010-03-20 Thread Mike Meyer
On Sat, 20 Mar 2010 08:11:49 -0700 (PDT) strattonbrazil wrote: > I'd like to separate my ui Swing/JOGL from the content, so my code is > relatively unaware of the UI around it. For example, I create a > global context that holds on my content. I then make a UI that when > the user does some int

Re: indexing only some elements of a sequence...

2010-03-20 Thread Per Vognsen
One last thing: On Sat, Mar 20, 2010 at 10:16 PM, Meikel Brandmeyer wrote: > Hi, > > On Sat, Mar 20, 2010 at 09:50:12PM +0700, Per Vognsen wrote: >> Aha! I Googled for scan in seq-utils and didn't find anything. It >> would be nice if people stuck to standard terminology that has a >> continuous

Re: indexing only some elements of a sequence...

2010-03-20 Thread Per Vognsen
Yeah, I was being a bit too glib. One of my favorite things about Clojure is definitely what you mention. As for the matter at hand, the name 'reductions' is perhaps more descriptive but the con is that it less standard and almost three times as long as 'scan'. The importance of descriptiveness in

Re: indexing only some elements of a sequence...

2010-03-20 Thread Meikel Brandmeyer
Hi, On Sat, Mar 20, 2010 at 09:50:12PM +0700, Per Vognsen wrote: > Aha! I Googled for scan in seq-utils and didn't find anything. It > would be nice if people stuck to standard terminology that has a > continuous history going back to the early 60s. So we use names like car and cdr? This is one o

separating ui and content in clojure

2010-03-20 Thread strattonbrazil
I'd like to separate my ui Swing/JOGL from the content, so my code is relatively unaware of the UI around it. For example, I create a global context that holds on my content. I then make a UI that when the user does some interaction like a mouse click or drag, the UI creates a new context. My OO

Re: Installation issues on slack 13.0 (ant?)

2010-03-20 Thread Tim Johnson
* Steve [100320 05:24]: > On Mar 20, 2:44 pm, Tim Johnson wrote: > > Unless you're hacking on clojure itself you don't need to build it, > there's a pre-built jar file in the zip you downloaded (clojure.jar). > So you won't need ant (ant is a like make for Java). Aha! > So you can just do wha

Re: clojure naming convention for accessors vs. local variables

2010-03-20 Thread strattonbrazil
Well, even in this case how do lisp programmers typically name their structs vs their variables? In java I could make an "Employee" class and then an "employee" object and it was easy to distinguish between the two. If it's not kosher to uppercase a struct, what's the convention for something lik

Re: Maven clojure:repl

2010-03-20 Thread Meikel Brandmeyer
Hi, On Sat, Mar 20, 2010 at 04:56:39AM -0700, alux wrote: > [INFO] The plugin 'org.apache.maven.plugins:maven-clojure-plugin' does > not exist > or no valid version could be found > > I dont know where to search for a solution, so I ask here. Just guessing: you don't have clojure-maven plugin

Re: indexing only some elements of a sequence...

2010-03-20 Thread Per Vognsen
Aha! I Googled for scan in seq-utils and didn't find anything. It would be nice if people stuck to standard terminology that has a continuous history going back to the early 60s. -Per On Sat, Mar 20, 2010 at 9:40 PM, Steve Purcell wrote: > Which looks the same as clojure.contrib.seq/reductions t

Re: How to use Clojure with Robocode

2010-03-20 Thread Heinz N. Gies
On Mar 19, 2010, at 8:56 , ubolonton wrote: > Hi, > > Has anyone been able to use Clojure with Robocode? > I've followed this http://www.fatvat.co.uk/2009/05/clojure-and-robocode.html > but got the error Hi, I hope that in a week or two I am able to release a 'mini game' as a tech demo for som

Re: indexing only some elements of a sequence...

2010-03-20 Thread Steve Purcell
Which looks the same as clojure.contrib.seq/reductions to me... -Steve On 20 Mar 2010, at 13:54, Per Vognsen wrote: > Learn to love scan: http://gist.github.com/338682 > > -Per > > On Sat, Mar 20, 2010 at 12:13 PM, Douglas Philips wrote: >> Hello all, >> I'm new to clojure, but not lisp. >

Re: lazy-xml returns 503 from w3.org

2010-03-20 Thread Heinz N. Gies
On Mar 20, 2010, at 7:20 , Brian Sletten wrote: > Turn off validation. Google around, you will find the parameters to do so. I read a article about this some while ago. the java XML parser aheads the standard definition be downloading the DTD from the w3c. While the w3c made up this silly guid

Re: indexing only some elements of a sequence...

2010-03-20 Thread Per Vognsen
Learn to love scan: http://gist.github.com/338682 -Per On Sat, Mar 20, 2010 at 12:13 PM, Douglas Philips wrote: > Hello all, >   I'm new to clojure, but not lisp. >   I'm looking for a functional way to index/number only some items of a > list. > >   For example, I know I can do this (indexed is

Re: For loop question

2010-03-20 Thread DmitriKo
I guess you want this: (for [x (range 4) y (range 4)] (str x y)) -- DmitriKo On Mar 20, 2:05 pm, WoodHacker wrote: > When I run the following: > >     (for [y (range 4)] (for [x (range 4)] (println x y))) > > I get what I expect  -  0 0, 1 0, 2 0, 3 0 etc., but at the end of > each y loop I als

Re: Installation issues on slack 13.0 (ant?)

2010-03-20 Thread Steve
On Mar 20, 2:44 pm, Tim Johnson wrote: > >   Let me focus the attention of anyone who might be reading this to >   the file named: >   `readme.txt' at the top of the directory unzipped from >   `clojure-1.1.0.zip' >   The following instructions (and ONLY the following instructions) >   are present

Re: overrding function from other namespace

2010-03-20 Thread Martin Hauner
Hi, yes, better than my solution. :) Wrapping the with-bindings around the run-tests I can drop the namespace switch. (with-bindings {#'clojure.contrib.mock/report-problem #'my-report- problem} (run-tests)) The only issue left is that when running the test with leiningen ("lein test") I don't

Re: overrding function from other namespace

2010-03-20 Thread Martin Hauner
Hi Kevin, On 20 Mrz., 00:34, Kevin Downey wrote: > why are you def'ing your functions in the mock namespace? why are you > juggling namespaces at all? Because clojure.contrib.mock says so. The only way that worked for me was switching the namespace. Without switching the namespace I get: Name c

Clojure related project at the Google Summer of Code 2010

2010-03-20 Thread Bartosz Dobrzelecki
Hello. OMII-UK is running a Clojure related project as part of this year's GSoC. http://www.omii.ac.uk/wiki/OgsaDaiDqpClojure Please consider applying. Cheers, Bartek -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send emai

indexing only some elements of a sequence...

2010-03-20 Thread Douglas Philips
Hello all, I'm new to clojure, but not lisp. I'm looking for a functional way to index/number only some items of a list. For example, I know I can do this (indexed is from the contrib seq_utils library): (using a short example to keep it rea

Re: Translation from Common Lisp 1

2010-03-20 Thread alux
Hello Christophe, this one I like ;-) Thanks & regards, alux Christophe Grand schrieb: > If you really wan't to go that way you can also choose to remove the > namespaces: > (defn describe-path [[where what]] > (map (comp symbol name) `(there is a ~what going ~where from here.))) > > > On Fri,

Re: For loop question

2010-03-20 Thread Michał Marczyk
On 20 March 2010 13:05, WoodHacker wrote: > What's going on?   And how do I fix it?    Adding a :when to test for > nil does not seem to do anything. You'll want to use 'doseq' in place of 'for'. It uses exactly the same syntax as for, but is used solely for side effects (the return value is nil)

Re: lazy-cons

2010-03-20 Thread alux
And array-get seems to be aget by now. a. Jarkko Oranen schrieb: > On Mar 20, 1:52 pm, Glen Rubin wrote: > > Hey all, > > > > I am working through the problems on project euler.  On question > > number 11 (http://projecteuler.net/index.php?section=problems&id=11), > > I was unable to come up wit

Re: lazy-cons

2010-03-20 Thread Jarkko Oranen
On Mar 20, 1:52 pm, Glen Rubin wrote: > Hey all, > > I am working through the problems on project euler.  On question > number 11 (http://projecteuler.net/index.php?section=problems&id=11), > I was unable to come up with a solution, so I cheated and looked at > some other people's answer's here:  

Re: lazy-cons

2010-03-20 Thread alux
Hi Glen, it's lazy-seq now. Regards, alux Glen Rubin schrieb: > Hey all, > > I am working through the problems on project euler. On question > number 11 (http://projecteuler.net/index.php?section=problems&id=11), > I was unable to come up with a solution, so I cheated and looked at > some other

Re: For loop question

2010-03-20 Thread Heinz N. Gies
On Mar 20, 2010, at 13:05 , WoodHacker wrote: > When I run the following: > >(for [y (range 4)] (for [x (range 4)] (println x y))) > > I get what I expect - 0 0, 1 0, 2 0, 3 0 etc., but at the end of > each y loop I also get 4 nils. > > ((0 0 > 1 0 > 2 0 > 3 0 > nil nil nil nil) (0 1 > 1

For loop question

2010-03-20 Thread WoodHacker
When I run the following: (for [y (range 4)] (for [x (range 4)] (println x y))) I get what I expect - 0 0, 1 0, 2 0, 3 0 etc., but at the end of each y loop I also get 4 nils. ((0 0 1 0 2 0 3 0 nil nil nil nil) (0 1 1 1 2 1 3 1 nil nil nil nil) (0 2 What's going on? And how do I fix it?

Maven clojure:repl

2010-03-20 Thread alux
Hello, I'm just go through the Incanter getting-started http://data-sorcery.org/2009/12/20/getting-started/ There I find, that I can use mvn clojure:repl But that doesnt work. [ERROR] BUILD ERROR [INFO] [INFO] The plugin

lazy-cons

2010-03-20 Thread Glen Rubin
Hey all, I am working through the problems on project euler. On question number 11 (http://projecteuler.net/index.php?section=problems&id=11), I was unable to come up with a solution, so I cheated and looked at some other people's answer's here: http://clojure-euler.wikispaces.com/Problem+011

Re: Sequential vs. "divide and conquer" algorithm

2010-03-20 Thread Michał Marczyk
On 19 March 2010 17:53, Andrzej wrote: > I've been toying with various implementations of reduce-like > functions, trying to do something "smarter" than a simple iteration > over a collection of data. This hasn't worked out very well, my > implementation is a lot (~50x) slower than a simple loop.

questions on extending protocols

2010-03-20 Thread Stuart Halloway
The questions below refer to the gist at https://gist.github.com/336674/9ab832a86d203731c6379404d20afded79fe5f5b and to protocols in general: (1) Clojure automatically types hints the first argument when extending a protocol to an interface or class, which is great. But you cannot override

The 2010 Lisp Game Design Challenge

2010-03-20 Thread Lauri Oherd
Greetings, everyone, Just noticed that here is not yet a mention about The 2010 Lisp Game Design Challenge (http://dto.github.com/notebook/lgdc.html) where you can design, create, and release a game in 7 days using any dialect of Lisp, between 18 March and 1 April, 2010. I hope you find it interes