Re: Simple things should be simple

2010-09-10 Thread Mike Meyer
On Fri, 10 Sep 2010 01:08:06 -0400 John Newman john...@gmail.com wrote: (use '[clojure.contrib.server-socket :only (create-server)] '[clojure.contrib.duck-streams :only (read-lines)]) (create-server 8080 (fn [in out] (when-not (empty? (read-lines in)) (spit out Hello, World!\n

Re: Macro problems with delay

2010-09-10 Thread Konrad Hinsen
On 10 Sep 2010, at 03:11, joshua-choi wrote: And here is a full macro-expansion of the call at which the error happens: http://gist.github.com/572879 If I understand the comment (the following form is the culprit...) correctly, it's not the macroexpansion that fails, but the evaluation

Re: Standalone 1.2 contrib

2010-09-10 Thread Jacek Laskowski
On Fri, Sep 10, 2010 at 12:09 AM, Stuart Sierra the.stuart.sie...@gmail.com wrote: Do we need a direct link to the JAR on the download page?  That's easy enough. I think the easier the better for its adoption. If a single user has asked for it, I'd add it (even though others might consider

Re: drop-while and (pred item) returns nil?

2010-09-10 Thread Jacek Laskowski
On Fri, Sep 10, 2010 at 1:08 AM, Alan a...@malloys.org wrote: I'm not 100% sure what you're asking, but I think I understand you, and in that case you can refer to http://groups.google.com/group/clojure/browse_thread/thread/9c7f726709e24c12/b2e2696b70d924f2?show_docid=b2e2696b70d924f2, in

Re: Simple things should be simple

2010-09-10 Thread Meikel Brandmeyer
Hi, On 9 Sep., 20:46, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote: The first problem with that is that this stuff seems show up *everywhere* in Javaland. It's not just web apps, it's pretty much anything. You just lost me completely with your argumentation. I wrote a small

Re: Knowing in advance the complexity of count

2010-09-10 Thread Meikel Brandmeyer
Hi, On 9 Sep., 21:01, Randy Hudson randy_hud...@mac.com wrote: Inexplicably (counted? abcd) returns false. Why should it? String does not implement Counted. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

Re: matching with wild-cards in clojure multi-methods

2010-09-10 Thread Meikel Brandmeyer
Hi, On 9 Sep., 21:47, Daniel Werner daniel.d.wer...@googlemail.com wrote: Could this be a bug? No. Clojure does not enforce contracts in several places. Feed wrong things in and get undefined behaviour back. Only the contract is guaranteed. Everything else is an implementation detail and might

Re: Simple things should be simple

2010-09-10 Thread Laurent PETIT
2010/9/10 Meikel Brandmeyer m...@kotka.de: Hi, On 9 Sep., 20:46, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote: The first problem with that is that this stuff seems show up *everywhere* in Javaland. It's not just web apps, it's pretty much anything. You just lost me

Re: Knowing in advance the complexity of count

2010-09-10 Thread Laurent PETIT
2010/9/10 Meikel Brandmeyer m...@kotka.de: Hi, On 9 Sep., 21:01, Randy Hudson randy_hud...@mac.com wrote: Inexplicably (counted? abcd) returns false. Why should it? String does not implement Counted. Maybe when Counted becomes a protocol and is then extended to java.lang.String ? (Does

Re: Simple things should be simple

2010-09-10 Thread Meikel Brandmeyer
Hi, On 10 Sep., 10:27, Laurent PETIT laurent.pe...@gmail.com wrote: while I admit I haven't read *all* the answers to Meikel's question in their entirety, what I've understood is that :   * he's not talking about clojure the language, but its ecosystem (the JVM host and the J2EE stuff -de

Re: Simple things should be simple

2010-09-10 Thread Laurent PETIT
2010/9/10 Meikel Brandmeyer m...@kotka.de: Hi, On 10 Sep., 10:27, Laurent PETIT laurent.pe...@gmail.com wrote: while I admit I haven't read *all* the answers to Meikel's question in their entirety, what I've understood is that :   * he's not talking about clojure the language, but its

[ANN] http.async.client v0.2.0

2010-09-10 Thread Hubert Iwaniuk
I'm happy to announce release of http.async.client v0.2.0 an Asynchronous HTTP Client for Clojure. This is wrapper/adapter on top of http://github.com/AsyncHttpClient/async-http-client Project: http://github.com/neotyk/http.async.client/ Documentation:

Re: Some Problem with Recursion

2010-09-10 Thread Stefan Rohlfing
@ Nicolas and ajuc Thank you very much for showing me where I went wrong! With so many parentheses it sometimes happens that I misplace one Now the output of the function is as expected: (defn prefix-postfix [expr] (if (coll? expr) (let [ [op arg1 arg2] expr] [ (prefix-postfix arg1)

Re: Some Problem with Recursion

2010-09-10 Thread Laurent PETIT
2010/9/10 Stefan Rohlfing stefan.rohlf...@gmail.com: @ Nicolas and ajuc Thank you very much for showing me where I went wrong! With so many parentheses it sometimes happens that I misplace one Now the output of the function is as expected: (defn prefix-postfix [expr]  (if (coll? expr)    

Re: Some Problem with Recursion

2010-09-10 Thread Stefan Rohlfing
Hi Laurent, Thanks for your detailed explanation! It greatly helped me understand the usage of quoting. Stefan On Sep 10, 5:27 pm, Laurent PETIT laurent.pe...@gmail.com wrote: 2010/9/10 Stefan Rohlfing stefan.rohlf...@gmail.com: @ Nicolas and ajuc Thank you very much for showing

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-10 Thread Adam Burry
On Sep 9, 5:06 pm, alux alu...@googlemail.com wrote: But, @Luc pushing the advantage of Lisp macros to the forefront is not obvious if the audience cannot compare with another (good/simple) implementation they understand well. Thats why I want to use a nifty metaphor ;-) Even your dumbest

Problem importing JOptionPane from a string evaluated by load-string

2010-09-10 Thread Paul D. Fernhout
I'm just trying out Clojure a bit, so this may be an obvious simple thing I'm misunderstanding. This code in the test file below allows editing a Clojure function that is updated when an Update Code button is pressed, with the new value connected to a GUI button Click Me! as a proxy

Re: Simple things should be simple

2010-09-10 Thread Alessio Stalla
On Sep 9, 6:06 pm, Phil Hagelberg p...@hagelb.org wrote: On Thu, Sep 9, 2010 at 8:38 AM, Mike Meyer mwm-keyword-googlegroups.620...@mired.org wrote: And two tools - lein and clojure itself. I'm not sure Clojure should be counted separately since you're not installing it yourself. So we

Re: testing local functions?

2010-09-10 Thread James Reeves
On 10 September 2010 12:24, alux alu...@googlemail.com wrote: I always thought it to be good style to make helper functions only as visible as needed, e.g. by using letfn. But when I want to test my code, I just dont see a way to access these local functions for tests. I don't believe you

Re: testing local functions?

2010-09-10 Thread alux
Hi James, thanks for your answer. your tests should be testing your public interface Hhmmm. Well, I tend to disagree here. I sometimes like to have tests in place for things I want to refactor. To not inadvertently do something foolish. But I agree that this is not easily accomplishable.

Re: testing local functions?

2010-09-10 Thread Christian Vest Hansen
From someone who's window to your code is your public API, a refactoring should make no observable change. So if you only test on the public API, but you test it thoroughly, then your tests will ensure that this property holds. Tests that delve into implementation details and private things, are

Re: Simple things should be simple

2010-09-10 Thread John Cromartie
On Sep 9, 11:47 am, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote: On Thu, 9 Sep 2010 16:28:48 +0100 Edmund Jackson edmundsjack...@gmail.com wrote: Hi Mike,     Could you perhaps present a counter-example of greater simplicity ? $ cat -

Re: Problem importing JOptionPane from a string evaluated by load-string

2010-09-10 Thread Sean Devlin
Try printing out the *ns* variable in the fn. Chances are your code is being created in a different *ns* than it is being run. You can also try using the fully qualified path to get to JOptionPane, that may help too. On Sep 9, 9:43 pm, Paul D. Fernhout pdfernh...@kurtz-fernhout.com wrote: I'm

Re: Problem importing JOptionPane from a string evaluated by load-string

2010-09-10 Thread Laurent PETIT
Got it. You cannot invoke (import) (or (ns)) from within the function definition. The function is already being evaluated, and it's too late. This works fine for me: (do (import '(javax.swing JOptionPane)) ((fn [] (println Hello World) (println (+ 2 2))

Re: Problem importing JOptionPane from a string evaluated by load-string

2010-09-10 Thread Sean Devlin
I've also used the with-ns package in contrib to fix this. On Sep 10, 9:03 am, Laurent PETIT laurent.pe...@gmail.com wrote: Got it. You cannot invoke (import) (or (ns)) from within the function definition. The function is already being evaluated, and it's too late. This works fine for me:

Re: Simple things should be simple

2010-09-10 Thread brianh
Just to be contrary ;) A one time investment of 2 minutes (I did have to scrounge in contrib to locate these after all): (defn make-stupid-simple-script [f content] (spit f content) (sh chmod 755 (.getName f))) for the eternal pleasure of using: user= (make-stupid-simple-script (File.

Re: Simple things should be simple

2010-09-10 Thread gary ng
On Fri, Sep 10, 2010 at 4:47 AM, John Cromartie jcromar...@gmail.com wrote: #!/usr/local/bin/clj (println Content-type: text/plain\n) (println Hello, World!) ^D Is that simple enough? That was my thought too, java/clojure console app should not be more complex than python etc. The issue is

Re: [ANN] Leiningen 1.3.1

2010-09-10 Thread lprefontaine
I solved my maven corruption problem. On if the m2 index folder was not cleaned properly. Luc P, lprefonta...@softaddicts.ca wrote .. Hi Phil, I upgraded to 1.3.1 but started to experience some problems with my our-classe-only hook. I made it return 0 since 1.3.1 expects a numeric return

Leiningen-1.4.0-SNAPSHOT missing

2010-09-10 Thread Bahman Movaqar
Hi List, Today, trying to setup Clojure I downloaded 'leiningen.bat' from (http://github.com/technomancy/leiningen/raw/master/bin/lein.bat) and 'self-install' fails: C:\Users\Bahmanlein self-install SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc syswgetrc = C:\Program

Re: Simple things should be simple

2010-09-10 Thread John Newman
Finally, cat - /usr/local/www/apache22/cgi-bin/hello-world #!/usr/local/bin/clj (println Content-type: text/plain\n) (println Hello, World!) ^D I can start using Clojure again :) John -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-10 Thread lprefontaine
Adam Burry abu...@gmail.com wrote .. On Sep 9, 5:06 pm, alux alu...@googlemail.com wrote: But, @Luc pushing the advantage of Lisp macros to the forefront is not obvious if the audience cannot compare with another (good/simple) implementation they understand well. Thats why I want to

Re: Simple things should be simple

2010-09-10 Thread cody koeninger
On Sep 10, 1:32 am, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote: I think that Java's strength is enterprise-level, highly scalable web servers make people assume that every problem must be a nail for that hammer. I think that Unix's strength is small independent programs

What is ring/jetty doing with my *out*?

2010-09-10 Thread Colin Steele
It seems that when using ring/jetty, *out* is getting eaten or thrown away. I'm a n00b to clojure and the java world in general, but it seems odd that (prn something) should silently fail? I'm guessing that I'm missing some configuration somewhere? Help? :) --Colin -- You received this

Re: Leiningen-1.4.0-SNAPSHOT missing

2010-09-10 Thread Bahman Movaqar
On 2010/9/10 19:07, Bahman Movaqar wrote: Hi List, Today, trying to setup Clojure I downloaded 'leiningen.bat' from (http://github.com/technomancy/leiningen/raw/master/bin/lein.bat) and 'self-install' fails: C:\Users\Bahmanlein self-install SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc

Re: What is ring/jetty doing with my *out*?

2010-09-10 Thread James Reeves
On 10 September 2010 15:39, Colin Steele cvillecste...@gmail.com wrote: It seems that when using ring/jetty, *out* is getting eaten or thrown away.  I'm a n00b to clojure and the java world in general, but it seems odd that (prn something) should silently fail?  I'm guessing that I'm missing

Re: Clojure 1.2 and the Computer Language Benchmarks Game

2010-09-10 Thread Isaac Gouy
On Sep 9, 10:15 pm, gary ng garyng2...@gmail.com wrote: On Thu, Sep 9, 2010 at 10:04 PM, Isaac Gouy igo...@yahoo.com wrote: Is there any point speculating about this as outsiders? It was available - Data.HashTable seems to be copyright 2003.

Re: Macro problems with delay

2010-09-10 Thread joshua-choi
That ought to be correct, but I can't reconcile that with the error message. Doesn't the Can't embed object in code, maybe print-dup not defined error only appear in macros, when some object being spliced into a macro's expansion is not a basic Clojure form? Yet, you are correct, commenting out

Re: A difficult Metaphor for Macros (especially for Java people)

2010-09-10 Thread Adam Burry
On Sep 10, 1:10 pm, lprefonta...@softaddicts.ca wrote: Adam Burry abu...@gmail.com wrote .. On Sep 9, 5:06 pm, alux alu...@googlemail.com wrote: But, @Luc pushing the advantage of Lisp macros to the forefront is not obvious if the audience cannot compare with another (good/simple)

Clojure User Group around Geneva ?

2010-09-10 Thread Stéphane Tavera
Hi everyone, As a beginner in Clojure, I'm wondering if there is any kind of Clojure User Group around Geneva ? (If not, some friends of mine and I are willing to create one.) Thanks in advance, __ s t -- You received this message because you are subscribed to the Google Groups Clojure group.

Re: Macro problems with delay

2010-09-10 Thread joshua-choi
You're right about the namespace-qualification: I accidentally macroexpanded with syntax-quote rather than quote. My mistake; the actual expansion is the same, but without namespace-qualification. Using (var ~fn-name) results in the same error, unfortunately. I think now the attempted embedding

Re: Leiningen-1.4.0-SNAPSHOT missing

2010-09-10 Thread Phil Hagelberg
On Fri, Sep 10, 2010 at 7:37 AM, Bahman Movaqar b.mova...@gmail.com wrote: Also another strange thing is that when I open a command prompt and enter 'lein self-install' it fails; I figured out I have to issue a dummy 'lein new' first for 'self-install' to start.  C:\Users\Bahmanlein

clojure-test-mode elpa version still out of date?

2010-09-10 Thread User7
I'm using emacs starter kit and clojure-test-mode 1.4 installed using elpa. Running clojure-tests-run-tests seems to work fine, but clojure- test-run-test seems flakey. This blog post from May says the elpa version is out of date.

Re: Simple things should be simple

2010-09-10 Thread Raoul Duke
On Fri, Sep 10, 2010 at 1:27 AM, Laurent PETIT laurent.pe...@gmail.com wrote: These last few months, working on ccw has been particularly interesting because I've had feedback from users, especially Lee. Lee has challenged a lot of what I had considered to be simple things in ccw. I can say

Re: Macro problems with delay

2010-09-10 Thread joshua-choi
I've solved the problem. I found that it only occurred when general- defmaker was called with its forms argument containing another general- defmaker call with def-form being defmacro. Thus, in the inner general- defmaker call, the *result* of (NamedRule. (delay …)) was embedded into a defmacro

Re: Clojure 1.2 and the Computer Language Benchmarks Game

2010-09-10 Thread gary ng
On Fri, Sep 10, 2010 at 8:49 AM, Isaac Gouy igo...@yahoo.com wrote: Huh ? point ? it was just a casual comment, no point was intended. And I have read some comments by Don that what is in the shoutout is way faster than Data.HashTable If you knew there was another option why write I doubt

A Clojure Scholarship: Let's send Raynes to the Conj!

2010-09-10 Thread Chas Emerick
With a huge helping hand from Relevance, the host of the Conj in October, I'm hoping we can make it possible for Anthony Simpson (you may know him as Raynes in #clojure irc) to attend the conference. The blog post tells the story: http://bit.ly/9dmeDe I hope you'll check it out, and help

Re: What is ring/jetty doing with my *out*?

2010-09-10 Thread Colin Steele
Ahhh... I found it. I was actually using print not prn. Switching to prn works! :) (flushing?) On Sep 10, 11:30 am, James Reeves jree...@weavejester.com wrote: On 10 September 2010 15:39, Colin Steele cvillecste...@gmail.com wrote: It seems that when using ring/jetty, *out* is getting eaten

Re: Clojure 1.2 and the Computer Language Benchmarks Game

2010-09-10 Thread Isaac Gouy
On Sep 10, 10:35 am, gary ng garyng2...@gmail.com wrote: On Fri, Sep 10, 2010 at 8:49 AM, Isaac Gouy igo...@yahoo.com wrote: Huh ? point ? it was just a casual comment, no point was intended. And I have read some comments by Don that what is in the shoutout is way faster than

Re: Leiningen-1.4.0-SNAPSHOT missing

2010-09-10 Thread Bahman Movaqar
On 2010/9/10 21:42, Phil Hagelberg wrote: On Fri, Sep 10, 2010 at 7:37 AM, Bahman Movaqar b.mova...@gmail.com wrote: Also another strange thing is that when I open a command prompt and enter 'lein self-install' it fails; I figured out I have to issue a dummy 'lein new' first for

Re: Leiningen-1.4.0-SNAPSHOT missing

2010-09-10 Thread Bahman Movaqar
On 2010/9/10 21:42, Phil Hagelberg wrote: On Fri, Sep 10, 2010 at 7:37 AM, Bahman Movaqar b.mova...@gmail.com wrote: Also another strange thing is that when I open a command prompt and enter 'lein self-install' it fails; I figured out I have to issue a dummy 'lein new' first for

Re: clojure-test-mode elpa version still out of date?

2010-09-10 Thread User7
I downloaded clojure-mode from http://github.com/technomancy/clojure-mode and installed both clojure-mode.el and clojure-test-mode.el using M-x package-install-from-buffer. On the following set of tests, M-x clojure-test-run-tests seems to work, but M-x clojure-test-run-test on just the pass

Re: Clojure 1.2 and the Computer Language Benchmarks Game

2010-09-10 Thread gary ng
On Fri, Sep 10, 2010 at 11:13 AM, Isaac Gouy igo...@yahoo.com wrote: Clearly, they did choose to write all that code in order to get a much faster program - I can't tell you if Andy had noticed the benchmark was about Hashtable update and k-nucleotide strings or whether he knew about

Re: A Clojure Scholarship: Let's send Raynes to the Conj!

2010-09-10 Thread Alan
Did we really get this done in an hour? I haven't been part of the community for long, but Rayne has been helpful to me already on #clojure so I was going to donate a bit. Did I already miss my chance? On Sep 10, 10:39 am, Chas Emerick cemer...@snowtide.com wrote: With a huge helping hand from

Re: A Clojure Scholarship: Let's send Raynes to the Conj!

2010-09-10 Thread Sean Devlin
Welcome to Clojure On Sep 10, 2:55 pm, Alan a...@malloys.org wrote: Did we really get this done in an hour? I haven't been part of the community for long, but Rayne has been helpful to me already on #clojure so I was going to donate a bit. Did I already miss my chance? On Sep 10, 10:39 am,

Re: testing local functions?

2010-09-10 Thread Brian Marick
I've worked out a way to test local functions. When I tried it out by hand, it felt good. See here: http://bit.ly/b1AoG7 Implementing it is on my wishlist for Midje, my test framework. http://github.com/marick/Midje On Sep 10, 2010, at 6:24 AM, alux wrote: Hello, I always thought it to

Re: A Clojure Scholarship: Let's send Raynes to the Conj!

2010-09-10 Thread Chas Emerick
Just a little over an hour, yes! Raynes is going to the Conj. Thanks to all who donated. More info, numbers, and more thank-yous here: http://bit.ly/aj0XPr And, if you *wanted* to donate, but ended up coming in after we hit our goal, please read the above post anyway. :-) Thanks again

Re: Simple things should be simple

2010-09-10 Thread Mike Meyer
On Fri, 10 Sep 2010 00:03:22 -0700 (PDT) Meikel Brandmeyer m...@kotka.de wrote: Hi, On 9 Sep., 20:46, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote: The first problem with that is that this stuff seems show up *everywhere* in Javaland. It's not just web apps, it's pretty

Re: A Clojure Scholarship: Let's send Raynes to the Conj!

2010-09-10 Thread Rayne
I wrote a brief thank you post on my blog (actually the first post on this new blog. :) http://blog.acidrayne.net/thank-you-for-sending-me-to-the-conj I'm unbelievably excited. I love you guys. On Sep 10, 2:09 pm, Chas Emerick cemer...@snowtide.com wrote: Just a little over an hour, yes!  

Re: Simple things should be simple

2010-09-10 Thread Mike Meyer
On Fri, 10 Sep 2010 07:11:18 -0700 gary ng garyng2...@gmail.com wrote: On Fri, Sep 10, 2010 at 4:47 AM, John Cromartie jcromar...@gmail.com wrote: #!/usr/local/bin/clj (println Content-type: text/plain\n) (println Hello, World!) ^D Is that simple enough? That was my thought too,

Generating functions programmatically

2010-09-10 Thread icemaze
Hi, I'm developing a small DSL with Clojure and I need to define many similar functions. I'd like to do that programmatically, of course. My solution (involving a simple macro) doesn't work, so I won't bother you with it. I'll post it if anyone asks. Basically what I need is: given a list of

Re: Macro problems with delay

2010-09-10 Thread Cyrus Harmon
This still doesn't quite add up to me. What's the consequence of not alter-var-root'ing maker-var# if def-form is a defmacro? Why would def-form be a defmacro in the first place? Also, I don't think you've given the example of the actual call that gave the error, only the macroexpansion of

Re: A Clojure Scholarship: Let's send Raynes to the Conj!

2010-09-10 Thread Rayne
Just told that the site went down: not sure why, but I'll work on it later. Sorry. 3 On Sep 10, 2:21 pm, Rayne disciplera...@gmail.com wrote: I wrote a brief thank you post on my blog (actually the first post on this new blog. :)http://blog.acidrayne.net/thank-you-for-sending-me-to-the-conj

Re: Generating functions programmatically

2010-09-10 Thread Alan
I actually did this just the other day, to create a simple C-style enum macro (I assume someone has a better version; this was a learning exercise). You can see my project at www.github.com/amalloy/enum. It sounds like your problem might be constructing the symbol to define; the solution will look

Re: Generating functions programmatically

2010-09-10 Thread Alan
SPOILER BELOW. I'm not sure how much help you want, so I went ahead and wrote your macro. Whitespace padding so that you won't see it if you don't want the whole solution: user= (defmacro make-fn [key] (let [sym (- key name (str synthetic-) symbol)] `(defn ~sym [n#] (= n# ~key

Re: A Clojure Scholarship: Let's send Raynes to the Conj!

2010-09-10 Thread Alan
It's working for me now (but wasn't earlier, so this is probably a sign that it's fixed). On Sep 10, 12:57 pm, Rayne disciplera...@gmail.com wrote: Just told that the site went down: not sure why, but I'll work on it later. Sorry. 3 On Sep 10, 2:21 pm, Rayne disciplera...@gmail.com wrote:

Re: testing local functions?

2010-09-10 Thread alux
Brian, thats way cool! (I still have to think this through, thats high magic!) Thank you for sharing this, and kind regards, alux On 10 Sep., 21:04, Brian Marick mar...@exampler.com wrote: I've worked out a way to test local functions. When I tried it out by hand, it felt good. See

Re: Generating functions programmatically

2010-09-10 Thread icemaze
Alan, thank you for your reply. Unfortunately your solution is very similar to mine and it suffers from the same problem (maybe I'm using it incorrectly, I don't know). If I write: (doseq [x '(:a :b)] (make-fn x)) it defines a single function synthetic-x. Is there a way to make this work?

Re: Simple things should be simple

2010-09-10 Thread Phil Hagelberg
On Fri, Sep 10, 2010 at 12:17 PM, Mike Meyer mwm-keyword-googlegroups.620...@mired.org wrote: 1) Write program in chosen language that runs on the JVM. 2) Compile program to class file(s). 3) Use some tool to create a manifest file. 4) Run jar to create jar file. 5) Distribute jar file.

Re: Clojure 1.2 and the Computer Language Benchmarks Game

2010-09-10 Thread Isaac Gouy
On Sep 10, 11:54 am, gary ng garyng2...@gmail.com wrote: On Fri, Sep 10, 2010 at 11:13 AM, Isaac Gouy igo...@yahoo.com wrote: Clearly, they did choose to write all that code in order to get a much faster program - I can't tell you if Andy had noticed the benchmark was about Hashtable

Re: A Clojure Scholarship: Let's send Raynes to the Conj!

2010-09-10 Thread Rayne
http://blog.acidrayne.net/?p=4 I threw up a wordpress site and posted this there. Maybe it'll last through a couple requests. :p On Sep 10, 2:57 pm, Rayne disciplera...@gmail.com wrote: Just told that the site went down: not sure why, but I'll work on it later. Sorry. 3 On Sep 10, 2:21 pm,

Re: Simple things should be simple

2010-09-10 Thread Meikel Brandmeyer
Hi, Am 10.09.2010 um 21:17 schrieb Mike Meyer: 1) Write program in chosen unix-friendly interpreted language. You lost exactly here. unix-friendly. Since you keep putting your context over everything, I will also keep on putting mine over everything. Ruby, Python, Perl, Tcl, ... are all not

Re: Clojure 1.2 and the Computer Language Benchmarks Game

2010-09-10 Thread gary ng
On Fri, Sep 10, 2010 at 2:04 PM, Isaac Gouy igo...@yahoo.com wrote: It's starting to look like actually there was a point you wanted to make ;-) You mean the 'no chice' part ? yes. You mean the why not Data.Hashtable comment ? I don't think so. If you change the requirement to something

Re: clojure-test-mode elpa version still out of date?

2010-09-10 Thread Bruce Durling
Hi, On Fri, Sep 10, 2010 at 18:15, User7 userseven...@gmail.com wrote: I'm using emacs starter kit and clojure-test-mode 1.4 installed using elpa.  Running clojure-tests-run-tests seems to work fine, but clojure- test-run-test seems flakey.  This blog post from May says the elpa version is

partition-starting-every : yet another partition function

2010-09-10 Thread Matt Smith
problem: convert a collection [1 2 0 1 2 3 0 1 2 3 0 0 1 2] into partitions like: ((1 2) (0 1 2 3) (0 1 2 3) (0) (0 1 2)) In this case, start each partition on a 0. I looked at the various partition functions but none of them would do the trick without adding unnecessary complexity. Instead I

Re: Generating functions programmatically

2010-09-10 Thread Hubert Iwaniuk
Hi icemaze, Please look at how fns are generated in http.async.client http://github.com/neotyk/http.async.client/blob/master/src/http/async/client/util.clj#L54 this macro is later used here: http://github.com/neotyk/http.async.client/blob/master/src/http/async/client.clj#L43 HTH, Hubert. On

Re: Clojure 1.2 and the Computer Language Benchmarks Game

2010-09-10 Thread Isaac Gouy
On Sep 10, 2:22 pm, gary ng garyng2...@gmail.com wrote: -snip- My initial comment was all about 'it seems that Haskell submission is not the typical elegant form' and to me because of the specific you want to measure, there is no acceptable elegant Haskell form. So what are we to do when

Re: Generating functions programmatically

2010-09-10 Thread Alan
I see. It's hard to imagine how this could work, since macros don't have access to runtime data like the value of x in your example. Perhaps you're better off writing a function that returns a closure, and iteratively def'ing those? user= (defn make-kw-fn [kw] #(= kw %))

Re: Generating functions programmatically

2010-09-10 Thread Alan
PS this is super-ugly and I'm always embarrassed when I find myself using eval in a lisp. While this works, I'd love it if someone could tell me how to do it with macros. On Sep 10, 3:07 pm, Alan a...@malloys.org wrote: I see. It's hard to imagine how this could work, since macros don't have

Re: Clojure 1.2 and the Computer Language Benchmarks Game

2010-09-10 Thread gary ng
On Fri, Sep 10, 2010 at 3:06 PM, Isaac Gouy igo...@yahoo.com wrote: So what are we to do when there's a problem that has no acceptable elegant Haskell form? Depending on the intend, for you benchmark program, write something like what it is now. For real life cases, call an exnternal library,

Re: Simple things should be simple

2010-09-10 Thread Mike Meyer
On Fri, 10 Sep 2010 23:21:01 +0200 Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 10.09.2010 um 21:17 schrieb Mike Meyer: 1) Write program in chosen unix-friendly interpreted language. You lost exactly here. unix-friendly. Since you keep putting your context over everything, I will

Re: Convenience (was Simple things should be simple)

2010-09-10 Thread Mike Meyer
On Fri, 10 Sep 2010 17:29:24 -0400 Stuart Halloway stuart.hallo...@gmail.com wrote: Hi Mike, I think this is more about convenience than simplicity. In both Unix and Java deployment is complex, and often complicated as well. In spite of this, small, one-off things should be convenient to

Re: Generating functions programmatically

2010-09-10 Thread Robert McIntyre
Why not explicitly feed the macro the keyword map if that is what it wants? (defmacro ultra-synth [prefix keywords] (let [symbols (map (comp symbol name) keywords) fn-names (map (comp symbol (partial str prefix) name) keywords) defn-forms (map

Re: Generating functions programmatically

2010-09-10 Thread Alan
It sounds like he's going to be given the list of keywords by the user, and won't have it as a compile-time literal. Maybe he's load'ing a .clj file, for example, that someone will write in the future. Maybe you can combine our two approaches to get something that works and isn't ugly, but I'm

Re: Generating functions programmatically

2010-09-10 Thread icemaze
Yeah, I guess I could use a macro to generate the call to the other macro in a way similar to how you used it. Thank you, that should definitely work. I'll try it right now. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: Generating functions programmatically

2010-09-10 Thread Robert McIntyre
there's always apply-macro from contrib for doing perverse stuff like that, so you don't have to *see* eval if you don't want to :) --Robert McIntyre On Fri, Sep 10, 2010 at 8:24 PM, icemaze icem...@gmail.com wrote: I agree: eval never looks pretty. -- You received this message because you

Re: Generating functions programmatically

2010-09-10 Thread icemaze
Yes, I think I'll have to pass the keywords as literals. I don't think there's a way around that (other than using eval, as per Alan's solution). I was too excited about Hubert's hint and I found myself in the exact same problem with the second macro. -- You received this message because you are

Re: Generating functions programmatically

2010-09-10 Thread icemaze
You are mostly right in your assumptions: I could dump the keywords in the clj as literals but it would be tedious and not elegant at all. Eval's not pretty but it works; plus it's there for a reason, like working around the shortcomings of the language (and of my brain). I was about to post my

Re: Generating functions programmatically

2010-09-10 Thread Btsai
This is probably not the prettiest way to do it, but I think it gets the job done: (defn make-sym [keyword] (- keyword name (str prefix-) symbol)) (defn make-fn [keyword] (let [n (gensym)] (list 'defn (make-sym keyword) [n] (list '= n keyword (defmacro make-fns [keywords] `(do

Re: Problem importing JOptionPane from a string evaluated by load-string

2010-09-10 Thread Paul D. Fernhout
On 9/10/10 9:03 AM, Laurent PETIT wrote: Got it. You cannot invoke (import) (or (ns)) from within the function definition. The function is already being evaluated, and it's too late. This works fine for me: (do (import '(javax.swing JOptionPane)) ((fn [] (println Hello World)

Re: Improved stack traces

2010-09-10 Thread Mike Hinchey
I found when working on ticket 191 (dead now, I suppose) that counting the stack elements is not reliable, but = works to get rid of duplicates. Below you can compare java's to your new function - the clojure has one duplicate element (the very last one). Also, I find the ... useful to know

Re: Generating functions programmatically

2010-09-10 Thread Robert McIntyre
That is very elegant but has the exact same problem in that the macro must be called on a literal vector of keywords. --Robert McIntyre On Fri, Sep 10, 2010 at 5:41 PM, Btsai benny.t...@gmail.com wrote: This is probably not the prettiest way to do it, but I think it gets the job done: (defn