ClojureCLR questions

2009-12-01 Thread Mike K
Hi Clojurites! I'm reading about Clojure and ClojureCLR with great interest. Since I'm a .net developer with little Java / JVM experience, I'm particularly interested in ClojureCLR. It seems like David M. and crew are doing a fantastic job with the CLR implementation! A few quick questions:

lazy sequence question

2009-12-09 Thread Mike K
I'm working my way through Programming Clojure and got an unexpected result with sequences: user (take 10 (filter even? (iterate inc 1))) (2 4 6 8 10 12 14 16 18 20) user (take-while #( % 10) (iterate inc 1)) (1 2 3 4 5 6 7 8 9) user (take 10 (filter #( % 10) (iterate inc 1))) ; Evaluation

Re: lazy sequence question

2009-12-09 Thread Mike K
On Dec 9, 10:35 pm, Mike K mbk.li...@gmail.com wrote: The first two work but the third one hangs.  Why? user (take 5 (filter #( % 10) (iterate inc 1))) (1 2 3 4 5) OK, I figured out that it won't hang with taking = 9 elements, which is the total that pass the filter. But shouldn't it give me

Re: lazy sequence question

2009-12-09 Thread Mike K
Neither filter nor take know to abandon their attempt. That's how this   works. Ah, of course. Thanks Mark and Richard! Mike -- 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

Re: Leiningen in Python

2009-12-11 Thread Mike K
All, I tried to use this script on Windows and it blew up real good! I'm a Clojure, Java, and Leiningen newbie, so perhaps a kind soul can help me out. 1. lein self-install worked. It downloaded leiningen-1.0.0- standalone.jar. However, that contradicts the description at

Re: Leiningen in Python

2009-12-12 Thread Mike K
I could not get the python script to work, so I switched to the powershell version. I now understand that the leiningen-1.0.0-SNAPSHOT.jar is a so-called uberjar and contains all the dependencies for leiningen. However, the python script assumes clojure is from a separate jar which is not

Help! My slime-fu is broken!

2009-12-14 Thread Mike K
Hello Clojurians, I've a Clojure newbie, and I've just started running clojure-mode and slime under emacs (on Windows). I'm running into several issues. Some of these are definitely bugs in my understanding; others may be bugs in my install or the implementation itself. I'd appreciate any help

Re: Help! My slime-fu is broken!

2009-12-14 Thread Mike K
On Dec 14, 10:55 pm, Phil Hagelberg p...@hagelb.org wrote: How did you install slime? If you use trunk of slime you will run into breaking changes for which swank-clojure hasn't been updated yet. It's best to use ELPA, the Emacs package manager. (http://tromey.com/elpa) I tried to use ELPA at

Re: Help! My slime-fu is broken!

2009-12-14 Thread Mike K
On Dec 14, 10:40 pm, David Nolen dnolen.li...@gmail.com wrote: While I personally use Emacs+SLIME to do Clojure hacking this is generally a poor introduction to Clojure for newbies. Clojure is new enough territory without having to fight with your text editor and the idiosyncracies of SLIME

Re: Help! My slime-fu is broken!

2009-12-15 Thread Mike K
On Dec 15, 8:42 pm, Phil Hagelberg p...@hagelb.org wrote: Ah, OK.  That explains the overload of the term compile I'll add a note to this to the swank-clojure readme. Cool. I wasn't even aware that the CL version provided error navigation here. But it looks like it shouldn't be too hard

A tale of cond, clauses, and the docs

2009-12-19 Thread Mike K
What, exactly, is a clause in clojure? From seeing the term used in context, I inferred that it meant something along the lines of a keyword which can optionally be used to change the semantics of a form. Apparently, it means more than that. This is valid clojure: (defn sign [x] (cond ( x 0)

Re: A tale of cond, clauses, and the docs

2009-12-19 Thread Mike K
On Dec 19, 8:27 pm, Sean Devlin francoisdev...@gmail.com wrote:  :else was chose because it is simply not nil, and therefor always true. I suspected something along these lines soon after I posted. I did some more experimenting and discovered that :foo will work just as well as :else. So if I

Loading a .clj file automatically at repl startup?

2009-12-28 Thread Mike K
Is it possible to load a library such as foo.clj (with (ns foo ...) at the top of the file) into the repl automatically at startup, rather than having to (use 'foo) every time the repl starts? I'd like to avoid creating a .jar file. If possible, I'd like to do this both from the command line

swank-clojure installation failure via ELPA

2010-01-02 Thread Mike K
Hi all, I'm trying to get all the latest and greatest swank-clojure 1.1.0 goodness via ELPA, but no joy. I'm starting with an absolutely clean slate. I'm running a freshly installed emacs 23.1.1 on Windows 7. I have a blank .emacs file and no elpa subdirectory under .emacs.d. I install elpa

Re: swank-clojure installation failure via ELPA

2010-01-02 Thread Mike K
On Jan 2, 9:13 am, Shawn Hoover shawn.hoo...@gmail.com wrote: Hi Mike, Is there anything useful going on in *messages*? Here is the contents of *Messages*: Contacting host: tromey.com:80 Reading [text/plain]... 4k of 4k (100%) Reading... done. Reading [text/plain]... 54k of 54k (100%) Saving

Re: swank-clojure installation failure via ELPA

2010-01-02 Thread Mike K
On Jan 2, 12:18 pm, Shawn Hoover shawn.hoo...@gmail.com wrote: I believe you're running into the same coding issue that I did with ELPA on Windows. slime.el declares in its local variables that it has unix line endings, but ELPA's download process is saving it with windows line endings.

Re: swank-clojure installation failure via ELPA

2010-01-02 Thread Mike K
I'm up and running again. Thank you very much Shawn and Phil! Phil: For the sake of other Windows users, I suggest adding a pointer to the patched package.el in the readme until the issue is resolved. Mike -- You received this message because you are subscribed to the Google Groups Clojure

ClojureCLR under slime / emacs?

2010-02-13 Thread Mike K
Does anyone have ClojureCLR running under emacs via slime? Failing that, can anyone give me some pointers as to how I might hacking swank-clojure.el (or whatever) to get this to work? Mike -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Common Lisp's append

2010-02-18 Thread Mike K
Hey Clojurians, I'm a Clojure and Common Lisp newbie. I heard that Norvig's PAIP was a good book to study idiomatic CL code, so I've embarked on a project to translate the examples to / work the exercises in Clojure. I hope to complete this project before the end of this century :-) Regarding

Re: Common Lisp's append

2010-02-21 Thread Mike K
On Feb 19, 6:23 am, Chouser chou...@gmail.com wrote: In Clojure, if you could use conj on a vector but instead use concat on a list, you'll end up with code that is both non-idiomatic and runs slower than necessary. I found the exercise of doing the equivalent with Clojure vectors pretty

Re: Common Lisp's append

2010-02-21 Thread Mike K
Thanks, I ended up using Allegro via Lispbox here. http://www.gigamonkeys.com/lispbox/#download Mike -- 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

ClojureCLR status?

2010-02-25 Thread Mike K
I notice there have been no checkins to ClojureCLR in the last month and a half. Is something big in the works? Is absolutely nothing in the works? :-) If I check out and build the latest sources, how will it compare in terms of functionality to the Clojure main branch? In particular, does it

Re: ClojureCLR and swank-clojure: port to .NET or using IKVM?

2010-03-01 Thread Mike K
Hi Iwan, I'm very interested in this also. I inquired about it in the following thread: http://groups.google.com/group/clojure/browse_frm/thread/2954b1f005663bbf# In short, it appears nobody has attempted this. Unfortunately, I'm too much of a clojure and java newbie to be competent at doing

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-07 Thread Mike K
On Mar 4, 4:32 pm, Glen Stampoultzis gst...@gmail.com wrote: Getting swank-clojure going in Windows is also a pain.  To install it the recommended way via ELPA you need to patch the ELPA source code first.  This isn't documented at the swank-clojure site either. For others who are struggling

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-07 Thread Mike K
Is anyone familiar with running Maven (and possibly Polygot Maven) on Windows? Does it pretty much work as expected? The learning curve for Maven looks steeper than for Leiningen, but if it makes up for it with better documentation and being better-behaved, then it may be worth it. Mike --

What's an idiomatic translation of this CL data structure?

2010-03-09 Thread Mike K
In PAIP section 2.3, Norvig gives an example of a generative grammar: ;; common lisp (defparameter *simple-grammar* '((sentence - (noun-phrase verb-phrase)) (noun-phrase - (Article Noun)) (verb-phrase - (Verb noun-phrase)) (Article - the a) (Noun - man ball woman table)

Re: Why I have chosen not to employ clojure

2010-03-21 Thread Mike K
I would appreciate any feedback. According to the readme it requires bash or zsh. Any plans to support windows (without cygwin or other unix emulation)? I agree with Stuart that the user experience should be friendly on all supported platforms. Mike -- You received this message because

Re: seq-contains? in practice

2010-04-29 Thread Mike K
On Apr 29, 5:10 am, Stuart Halloway stuart.hallo...@gmail.com wrote: (There are a few calls to seq-contains? in the test suite for contrib,   and I wrote all of them. If you write lots of unit tests you already   know why such calls make sense there.) For those of us who are newbies, would

Re: ClojureCLR and WPF Data Binding

2010-05-08 Thread Mike K
Anyone else looking at this sort of thing, or even interested? I'm very interested although I'm not looking at it right now (still taking baby steps learning Clojure while waiting for ClojureCLR to mature a bit) ClojureCLR + WPF / Silverlight is ultimately where I want to go. Thanks for being a

Any demand for ClojureCLR support under slime / emacs?

2010-12-12 Thread Mike K
I really, really want ClojureCLR to play nice with emacs the way Clojure does. I've looked at the swank-clojure sources, but I really don't know enough about the Clojure and ClojureCLR internals to make much headway with this project. Still, I'd love to help out in any way that I can. Is anyone

chunked-seq? is lying?

2010-12-31 Thread Mike K
In 1.2, I don't understand why one of the sequences below is chunked, but the other is not. Also, chunked-seq? seems to be lying about the second one. user (take 1 (map #(do (print .) [% %2]) (range 100) (range 100))) (.[0 0]) user (take 1 (map #(do (print .) [%]) (range 100)))

Re: chunked-seq? is lying?

2010-12-31 Thread Mike K
OK, I understand the difference in behavior between the two maps. But why is chunked-seq? incorrect? user (take 1 (map #(do (print .) [%]) (range 100))) ([0]) user (chunked-seq? (range 100)) false user (chunked-seq? (map #(do (print .) [%]) (range 100))) false

Re: why the big difference in speed?

2010-09-19 Thread Mike K
What is the definition of microbench? -- 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

Is ClojureCLR converging toward a release?

2010-09-23 Thread Mike K
It was mentioned about six weeks ago that ClojureCLR was mostly 1.2 compatible with a few outstanding issues and a couple dozen failing tests. What is the status now? Is there still an intention of an official binary release with 1.2 level functionality, or has that target been dropped?

Re: Clojure for VS2010

2010-09-25 Thread Mike K
Wow, really cool. I'm looking forward to seeing this! Mike -- 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

Re: Is ClojureCLR converging toward a release?

2010-10-04 Thread Mike K
David, Rich: any further updates on this? Mike On Sep 24, 8:24 am, dmiller dmiller2...@gmail.com wrote:  Just waiting for that person's CA to be processed by Rich. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: Is ClojureCLR converging toward a release?

2010-10-11 Thread Mike K
Fantastic! Great job David and everyone else who contributed. Mike -- 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

Re: Is ClojureCLR converging toward a release?

2010-10-11 Thread Mike K
Fantastic! Great job David and everyone else who contributed. Mike -- 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

Re: Is ClojureCLR converging toward a release?

2010-10-11 Thread Mike K
Fantastic! Great job David and everyone else who contributed. Mike -- 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

A question regarding map destructuring

2010-11-01 Thread Mike K
This question is a bit abstruse, so please bear with me :-) Here is an example of a function with named arguments and default values from the book The Joy of Clojure. It uses optional arguments (via ) and map destructuring. (defn slope [ {:keys [p1 p2] :or {p1 [0 0] p2 [1 1]}}] (float (/

Re: string interpolation

2010-11-20 Thread Mike K
Check out the macro from clojure.contrib.strint. http://clojure.github.com/clojure-contrib/strint-api.html -- 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

Re: string interpolation

2010-11-20 Thread Mike K
Check out the macro from clojure.contrib.strint. http://clojure.github.com/clojure-contrib/strint-api.html -- 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

Re: string interpolation

2010-11-20 Thread Mike K
Check out the macro from clojure.contrib.strint. http://clojure.github.com/clojure-contrib/strint-api.html -- 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

with-meta vs ^{}

2010-11-22 Thread Mike K
In Programming Clojure Stuart Halloway says: It is important to note that the metadata reader macro is not the same as with-meta. The metadata reader macro adds metadata for the compiler, and with-meta adds metadata for your own data: (def ^{:testdata true} foo (with-meta [1 2 3] {:order