Re: Documentation tools

2010-09-09 Thread Laurent PETIT
2010/9/9 Mark Engelberg : > On Wed, Sep 8, 2010 at 11:56 PM, Laurent PETIT > wrote: >>> Full ack here. >> >> For the non english speaker I am : is this a pun/playword ? (full ack >> <-> f..ck all) ? > > I assume he meant "full acknowledgment" -- an expression of agreement. Yes, but since Phil in

Re: can't def m-bind because namespace

2010-09-09 Thread Nicolas Oury
Not really, but monad can be a bit tricky at first. Your first email was a namespace related problem, that has little to do with monads. But it can be better to start with other part of clojure and come back to monads later. They can be useful to refactor code or write a nicer program, but you c

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

2010-09-09 Thread Laurent PETIT
Hello, 2010/9/9 Sean Corfield : > On Wed, Sep 8, 2010 at 7:28 AM, CuppoJava wrote: >> I found the easiest way to introduce macros is just to introduce them >> as small syntactic sugaring. For example, getting rid of the explicit >> (fn [] ...) for macros like (with-open file ...). > > Interesting

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

2010-09-09 Thread Konrad Hinsen
On 09.09.2010, at 09:48, Laurent PETIT wrote: > a. C/C++ is a "pre-processor". It does a first pass on the code. > Only at the end is the C/C++ compiler invoked. In Lisps, there is > still this "first pass/second pass" thing, but it's at a waay finer > granularity level: the top level form. Ther

Re: JSON lib of choice?

2010-09-09 Thread lance bradley
clj-json is a wrapper for jackson, i've never had a problem with it -- 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 y

wrap-reload and sandbar session

2010-09-09 Thread Rob McBride
Hi, It seems that when using ring's wrap-reload to automatically load changes, sandbar session seems to not work. Has anyone else noticed this? Is this a possible bug? I've added ring's wrap-reload to session_demo.clj and the demo breaks. Any work arounds? I would love to be able to use wrap-rel

lisp error system in clojure

2010-09-09 Thread Seth
Is there any code out there which reproduces common lisp's restart error handling capabilities? -- 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 moderate

Re: $'s in java class member names and set!

2010-09-09 Thread Jon Seltzer
Yeah. I tried that but it gives what you expect: Class A defined as follows: package projects.test; public class A { public boolean y; public boolean $z; } REPL: user=> (import '(projects.test A)) projects.test.A user=> (def m (A.)) #'user/m user=> (set! (. m y) true) true user=> (set! (.

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

2010-09-09 Thread Alessio Stalla
On Sep 8, 5:41 pm, lprefonta...@softaddicts.ca wrote: > Writing tons of XML lines to control behavior of frameworks was also a turn > off. We use Spring to create low-level Java beans but the XML describing > these beans did not change much over time. That is acceptable. I think Lisp is very well

Re: $'s in java class member names and set!

2010-09-09 Thread Michał Marczyk
That's probably due to a problem with clojure.core/munge I recently reported on the Dev list [1] -- see a proposed patch attached to my first e-mail in that thread. I notice there still hasn't been any response to that issue... I think I'm just going to go ahead an open a ticket for this tonight.

Re: $'s in java class member names and set!

2010-09-09 Thread Michał Marczyk
Ticket created: http://www.assembla.com/spaces/clojure/tickets/433-munge-should-not-munge-$-(which-isjavaidentifierpart)--should-munge---(which-is-not) Sincerely, Michał -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send ema

Re: lisp error system in clojure

2010-09-09 Thread Meikel Brandmeyer
Hi, On 9 Sep., 05:31, Seth wrote: > Is there any code out there which reproduces common lisp's restart > error handling capabilities? I think clojure.contrib.error-kit is the closest approach. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups "Cloj

Re: Standalone 1.2 contrib

2010-09-09 Thread faenvie
*1* a java-based alternative to maven and ant is gradle. pro: - gradle is a fantastic build-framework contra: - gradle is not leightweight -> even more thirdparty-dependencys - build-scripts are implemented in a groovy-based DSL -> gradle-users have to learn groovy basics i think a clojure-p

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

2010-09-09 Thread Andrew Gwozdziewycz
On Thu, Sep 9, 2010 at 3:48 AM, Laurent PETIT wrote: > Hello, > > 2010/9/9 Sean Corfield : >> On Wed, Sep 8, 2010 at 7:28 AM, CuppoJava wrote: >>> I found the easiest way to introduce macros is just to introduce them >>> as small syntactic sugaring. For example, getting rid of the explicit >>> (f

Some Problem with Recursion

2010-09-09 Thread Stefan Rohlfing
In order to get some more insight into recursion I wrote the following function but ended up in confusion: (defn prefix->postfix [expr] (if (coll? expr) (let [ [op arg1 arg2] expr] [ (prefix->postfix arg1) (prefix->postfix arg2) op])) expr) I expected the result to be a vector, su

Re: Some Problem with Recursion

2010-09-09 Thread ajuc
On 9 Wrz, 14:30, Stefan Rohlfing wrote: > In order to get some more insight into recursion I wrote the following > function but ended up in confusion: > > (defn prefix->postfix [expr] >   (if (coll? expr) >     (let [ [op arg1 arg2] expr] >       [ (prefix->postfix arg1) (prefix->postfix arg2) o

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

2010-09-09 Thread Laurent PETIT
2010/9/9 Andrew Gwozdziewycz : > On Thu, Sep 9, 2010 at 3:48 AM, Laurent PETIT wrote: >> Hello, >> >> 2010/9/9 Sean Corfield : >>> On Wed, Sep 8, 2010 at 7:28 AM, CuppoJava >>> wrote: I found the easiest way to introduce macros is just to introduce them as small syntactic sugaring. For

Re: Some Problem with Recursion

2010-09-09 Thread Nicolas Oury
Yes. Have someone (for example your editor), do your indentation for you. By typing on tab on a good editor, you would have has: (defn prefix->postfix [expr] (if (coll? expr) (let [ [op arg1 arg2] expr] [ (prefix->postfix arg1) (prefix->postfix arg2) op])) expr) which is easier

Re: Some Problem with Recursion

2010-09-09 Thread Stefan Rohlfing
The indentation was correct by got messed up when I copying the code. This is how I interpret the function: 'expr' is only returned if (coll? expr) returns 'false', with is not the case with an argument such as '(+ 2 4). Next, this expression is destructured in the 'let' and 'prefix- >postfix call

Re: Some Problem with Recursion

2010-09-09 Thread Nicolas Oury
(defn prefix->postfix [expr] (if (coll? expr) (let [ [op arg1 arg2] expr] [ (prefix->postfix arg1) (prefix->postfix arg2) op])) ;; HERE: 2 closing brackets first one close the let. second close the if. expr) In Clojure, (if test expr else) is the if expression. Here, you do (if test t

Re: Some Problem with Recursion

2010-09-09 Thread ajuc
On 9 Wrz, 15:27, Stefan Rohlfing wrote: > The indentation was correct by got messed up when I copying the code. > > This is how I interpret the function: > 'expr' is only returned if (coll? expr) returns 'false', with is not > the case with an argument such as '(+ 2 4). > Next, this expression i

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

2010-09-09 Thread ajuc
On 9 Wrz, 14:25, Andrew Gwozdziewycz wrote: > The fact that Lisp macros actually operate on the AST means that Lisp > macros can make *changes* to the AST (insert things, remove things, > rearrange things), and *not* just substitute FOO for BAR. This is a > hell of a lot more powerful. > > --htt

Simple things should be simple

2010-09-09 Thread Mike Meyer
I've spent far more time evaluating clojure than I had expected to. Part of the problem is that I'm of two minds. I love the language - it seems to mix in just the right bits of LISP, data structures from modern dynamic languages, and functional programming. On the other hand, I'm repelled by the

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

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 07:04:00 -0700 (PDT) ajuc wrote: > [In C] you can't output different code in macro depending on the > structure of its arguments That, of course, is a *crucial* difference. Think about the same restriction outside the macro environment: what would programming be like in a lang

Re: Simple things should be simple

2010-09-09 Thread Laurent PETIT
2010/9/9 Mike Meyer : > I've spent far more time evaluating clojure than I had expected > to. Part of the problem is that I'm of two minds. I love the language > - it seems to mix in just the right bits of LISP, data structures from > modern dynamic languages, and functional programming. > > On the

Knowing in advance the complexity of count

2010-09-09 Thread Nicolas Oury
Dear all, I want to write a generic code that use count when it is O(1) and not when it is not O(n), is it a way to do so? Best regards, Nicolas -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegr

Re: Simple things should be simple

2010-09-09 Thread Meikel Brandmeyer
Hi, I don't know what the full definition of "deploy" is, but here is an example, that should serve as a starting point: http://m.3wa.com/?p=472 Sincerely Meikel -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cl

Re: Knowing in advance the complexity of count

2010-09-09 Thread Meikel Brandmeyer
Hi, On 9 Sep., 16:45, Nicolas Oury wrote: > is it a way to do so? You can check the Counted marker interface for clojure collections. But this won't cover Strings etc. More information here: http://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L489 Sincerely Meikel -- Y

Re: Simple things should be simple

2010-09-09 Thread David Nolen
On Thu, Sep 9, 2010 at 10:07 AM, Mike Meyer < mwm-keyword-googlegroups.620...@mired.org> wrote: > So, I'm asking for someone to show me I'm wrong. In particular, if I > wanted to deploy a simple web app (the classic "Hello World") on your > favorite java or clojure web framework, how many lines of

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 07:46:22 -0700 (PDT) Meikel Brandmeyer wrote: > Hi, > > I don't know what the full definition of "deploy" is, but here is an > example, that should serve as a starting point: http://m.3wa.com/?p=472 That's a good example of simple things not being simple. Before I've seen a

Re: Simple things should be simple

2010-09-09 Thread Edmund Jackson
Hi Mike, Could you perhaps present a counter-example of greater simplicity ? Edmund On Thu, Sep 9, 2010 at 4:03 PM, Mike Meyer < mwm-keyword-googlegroups.620...@mired.org> wrote: > On Thu, 9 Sep 2010 07:46:22 -0700 (PDT) > Meikel Brandmeyer wrote: > > > Hi, > > > > I don't know what the fu

Re: Knowing in advance the complexity of count

2010-09-09 Thread Nicolas Oury
Thank you very much. Never looked closely at count definition. I assumed it was a forawrd to .count of Counted, which explains my problem. I kind of remembered the O(1) of Counted and get mixed up. Best regards, Nicolas. On Thu, Sep 9, 2010 at 3:50 PM, Meikel Brandmeyer wrote: > Hi, > > On 9

Re: Simple things should be simple

2010-09-09 Thread Laurent PETIT
2010/9/9 Mike Meyer : > I've spent far more time evaluating clojure than I had expected > to. Part of the problem is that I'm of two minds. I love the language > - it seems to mix in just the right bits of LISP, data structures from > modern dynamic languages, and functional programming. > > On the

Re: Simple things should be simple

2010-09-09 Thread Wilson MacGyver
I'm not sure what your point is. If I want to write a hello world php script on a unix system, but apache and mod_php weren't setup. I'd first have to install them and configure them. This is only easy these days because most linux come with apache installed, php installed, mod_php preconfigured f

Re: Simple things should be simple

2010-09-09 Thread Wilson MacGyver
I'm not sure what your point is. If I want to write a hello world php script on a unix system, but apache and mod_php weren't setup. I'd first have to install them and configure them. This is only easy these days because most linux come with apache installed, php installed, mod_php preconfigured f

Re: Knowing in advance the complexity of count

2010-09-09 Thread Sunil S Nandihalli
actually there is a function called counted? Sunil. On Thu, Sep 9, 2010 at 8:59 PM, Nicolas Oury wrote: > Thank you very much. > > Never looked closely at count definition. > > I assumed it was a forawrd to .count of Counted, which explains my problem. > > I kind of remembered the O(1) of Coun

Re: wrap-reload and sandbar session

2010-09-09 Thread Brenton
Rob, Ring stores session data in an atom. Reloading re-defines the atom to be empty. Sandbar uses Ring's session store. I have made a small change to Ring in my branch which fixes this problem. See http://github.com/brentonashworth/ring/commit/ebcdb3ec8adfc5c82d5fd6031f444a105701a8e0. I don't see

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 10:59:28 -0400 David Nolen wrote: > If you're going for simplicity over robustness and you have lein installed, > all you need to do is the following: > > lein new nano-web Yup - the goal is simplicity. Robustness is important, but I expect the web server to take care of

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 16:28:48 +0100 Edmund Jackson wrote: > Hi Mike, > > Could you perhaps present a counter-example of greater simplicity ? $ cat - > /usr/local/www/apache22/cgi-bin/hello-world.sh #!/bin/sh echo 'Content-type: text/plain\n' echo Hello World ^D $ chomd 755 /usr/local/www/apa

Re: Simple things should be simple

2010-09-09 Thread Wilson MacGyver
How are you going to handle session? How are you going to handle database from a echo script? I mean, I can counter by just create a hello.html in apache and put "hello world" in there. It's 1 line, 0 to deploy. And it's FAST. It's even cached and uses no cpu time being served. that doesn't reall

Re: Simple things should be simple

2010-09-09 Thread David Nolen
On Thu, Sep 9, 2010 at 11:38 AM, Mike Meyer wrote: > Yup - the goal is simplicity. Robustness is important, but I expect > the web server to take care of that. What I'm really expecting to lose > here is performance. performance? > You mean src/nano_web/core.clj. > Good catch. > So we go f

Re: Simple things should be simple

2010-09-09 Thread Zach Tellman
Lines of code are a terrible metric for language complexity. If I write a function and abstract away half the code, have I made Clojure twice as simple? If you want to really evaluate Clojure, write a non-trivial application and see whether the complexity is still manageable. Code golf doesn't t

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 11:30:51 -0400 Wilson MacGyver wrote: > I'm not sure what your point is. If I want to write a hello world php > script on a unix > system, but apache and mod_php weren't setup. I'd first have to install them > and configure them. That simple things should be simple. Setting up

Re: Simple things should be simple

2010-09-09 Thread Phil Hagelberg
On Thu, Sep 9, 2010 at 8:38 AM, Mike Meyer 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 go from 3, 0, 1 to 6, 4, 2. I'm not sure that qualifies as > simple, but at least there's less boilerpla

Re: Simple things should be simple

2010-09-09 Thread Edmund Jackson
You assume the presence of a configured web server but not a text editor ? The only constructive thing I can say is that the set of things that may be considered simple in the clojure setup above is vastly greater than the alternative you present. If the cost is a 4 line 'boilerplate' (and I'm poi

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 11:57:23 -0400 David Nolen wrote: > On Thu, Sep 9, 2010 at 11:38 AM, Mike Meyer wrote: > > > Yup - the goal is simplicity. Robustness is important, but I expect > > the web server to take care of that. What I'm really expecting to lose > > here is performance. > performance?

Re: Simple things should be simple

2010-09-09 Thread Wilson MacGyver
On Thu, Sep 9, 2010 at 12:05 PM, Mike Meyer wrote: > On Thu, 9 Sep 2010 11:30:51 -0400 >> Now it's true that there are some overhead to make sure your webapp produce >> a war file and can be deployed to ANY containers. It's not 3/1/0 as you >> claimed. > > A) I didn't claim I could do this with w

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 09:03:38 -0700 (PDT) Zach Tellman wrote: > Lines of code are a terrible metric for language complexity. If I > write a function and abstract away half the code, have I made Clojure > twice as simple? Ah, I'm sorry - I'm not looking at *language* complexity. I'm looking at the

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 09:06:49 -0700 Phil Hagelberg wrote: > On Thu, Sep 9, 2010 at 8:38 AM, Mike Meyer > wrote: > > And two tools - lein and clojure itself. > I'm not sure Clojure should be counted separately since you're not > installing it yourself. Installation isn't the issue, use is the issu

Re: Simple things should be simple

2010-09-09 Thread David Nolen
On Thu, Sep 9, 2010 at 12:22 PM, Mike Meyer < mwm-keyword-googlegroups.620...@mired.org> wrote: > Clojure great. No questions about that. WAR files, CLASSPATHs, having > to wrap *every little command* in it's own script - that's what I'm > looking at. I've already shown that you don't need WAR f

Re: Clojure 1.2 and the Computer Language Benchmarks Game

2010-09-09 Thread Isaac Gouy
On Sep 2, 4:51 pm, Isaac Gouy wrote: > On Sep 1, 9:46 pm, John Fingerhut wrote: > > > Thanks to many people on this list in Aug 2009 who helped improve my code, > > to Johannes Friestad for writing a nice fast Clojure program using deftype > > for the n-body problem, to Isaac Gouy for setting u

Re: Simple things should be simple

2010-09-09 Thread Brenton
Mike, Your point has been made, simple things are simple. When you need to print "hello world" you don't need to bring Clojure into the picture. You could have given a much simpler example of needing to print "hello world" on the command line. echo "hello world" is much simpler than what you would

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 11:52:30 -0400 Wilson MacGyver wrote: > How are you going to handle session? How are you going to handle > database from a echo script? What, you've never generated HTML directly from an SQL script? Any good SQL system will do that for you. All of these things are *possible*

Re: $'s in java class member names and set!

2010-09-09 Thread Jon Seltzer
I suspect $ is in munge because Rich and company may want to use it as a special reader character. $'s used to access inner classes work fine. I'd be fine with that as long as there's still a way to access Java identifiers with dollar signs (perhaps a special macro). On Sep 9, 3:49 am, Michał Ma

Re: lisp error system in clojure

2010-09-09 Thread Seth
exact what i want! Heres a nice link which describes it http://pragprog.com/magazines/2009-07/when-things-go-wrong On Sep 9, 6:20 am, Meikel Brandmeyer wrote: > Hi, > > On 9 Sep., 05:31, Seth wrote: > > > Is there any code out there which reproduces common lisp's restart > > error handling capa

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

2010-09-09 Thread Andrew Gwozdziewycz
On Thu, Sep 9, 2010 at 10:04 AM, ajuc wrote: > > > On 9 Wrz, 14:25, Andrew Gwozdziewycz wrote: >> The fact that Lisp macros actually operate on the AST means that Lisp >> macros can make *changes* to the AST (insert things, remove things, >> rearrange things), and *not* just substitute FOO for BA

Re: Simple things should be simple

2010-09-09 Thread Bruce Durling
Mike, If you are happy with cgi and if we posit that clojure is a compiled language and leiningen is the same as make. The I submit the following bit of fluff: At a prompt: $ lein new hw $ cd hw $ lein deps Then edit project.clj to look as follows: (defproject hw "0.0.1" :description "The sm

Re: Simple things should be simple

2010-09-09 Thread Paul deGrandis
I think the point is missed with this example. Given your hello world example, how much effort does it take you to add URL args, make it operate like a RESTful resource, change the route that triggers it, add user sessions, address security concerns, template out responses, tweak those templates w

Re: Simple things should be simple

2010-09-09 Thread Andrew Gwozdziewycz
On Thu, Sep 9, 2010 at 12:05 PM, Mike Meyer wrote: > On Thu, 9 Sep 2010 11:30:51 -0400 > Wilson MacGyver wrote: > >> I'm not sure what your point is. If I want to write a hello world php >> script on a unix >> system, but apache and mod_php weren't setup. I'd first have to install them >> and con

Re: Simple things should be simple

2010-09-09 Thread Andrew Gwozdziewycz
On Thu, Sep 9, 2010 at 12:32 PM, David Nolen wrote: > On Thu, Sep 9, 2010 at 12:22 PM, Mike Meyer > wrote: >> >> Clojure great. No questions about that. WAR files, CLASSPATHs, having >> to wrap *every little command* in it's own script - that's what I'm >> looking at. > > I've already shown that

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 12:32:27 -0400 David Nolen wrote: > On Thu, Sep 9, 2010 at 12:22 PM, Mike Meyer < > mwm-keyword-googlegroups.620...@mired.org> wrote: > > > Clojure great. No questions about that. WAR files, CLASSPATHs, having > > to wrap *every little command* in it's own script - that's what

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 17:15:09 +0100 Edmund Jackson wrote: > You assume the presence of a configured web server but not a text editor ? Actually, I did assume a text editor - provided any text editor would do. I chose to use my favorite simple text editor (cat) here. > The only constructive thing

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 16:35:15 +0100 Bruce Durling wrote: > Mike, > > If you are happy with cgi and if we posit that clojure is a compiled > language and leiningen is the same as make. The I submit the following > bit of fluff: > > At a prompt: > > $ lein new hw > $ cd hw > $ lein deps > > Then

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 09:06:33 -0700 (PDT) Paul deGrandis wrote: > I think the point is missed with this example. > > Given your hello world example, how much effort does it take you to > add URL args, make it operate like a RESTful resource, change the > route that triggers it, add user sessions,

Re: lisp error system in clojure

2010-09-09 Thread Chouser
On Thu, Sep 9, 2010 at 9:21 AM, Seth wrote: > exact what i want! > Heres a nice link which describes it > > http://pragprog.com/magazines/2009-07/when-things-go-wrong If you actually use any of the continue or continue-with features in real-world code, or build any kind of error hierarchy, please

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 12:23:25 -0400 Andrew Gwozdziewycz wrote: > On Thu, Sep 9, 2010 at 12:05 PM, Mike Meyer > wrote: > > On Thu, 9 Sep 2010 11:30:51 -0400 > > Wilson MacGyver wrote: > > > >> I'm not sure what your point is. If I want to write a hello world php > >> script on a unix > >> system,

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 09:41:09 -0700 (PDT) Brenton wrote: > Mike, > > Your point has been made, simple things are simple. When you need to > print "hello world" you don't need to bring Clojure into the picture. > You could have given a much simpler example of needing to print "hello > world" on the

Re: Simple things should be simple

2010-09-09 Thread Raoul Duke
On Thu, Sep 9, 2010 at 10:07 AM, Mike Meyer wrote: > The difference is that that 4 lines has to be repeated *for every > project*. Yeah, /usr/local/etc/apache/conf.d is a lot more > complicated. But I only need to do it once, and it works for every > application. until you need to change it to su

Re: Simple things should be simple

2010-09-09 Thread Brenton
Mike, While evaluating Clojure, just remember, you don't have use it for everything. When you need something simple, as in your examples, then use cgi. When you need to do something more complex then Clojure can help. You cannot deploy a .clj script on a running Tomcat (yet). When you install Tom

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 11:00:48 -0700 Raoul Duke wrote: > On Thu, Sep 9, 2010 at 10:07 AM, Mike Meyer > wrote: > > The difference is that that 4 lines has to be repeated *for every > > project*. Yeah, /usr/local/etc/apache/conf.d is a lot more > > complicated. But I only need to do it once, and it w

Re: Simple things should be simple

2010-09-09 Thread David Nolen
On Thu, Sep 9, 2010 at 2:17 PM, Mike Meyer < mwm-keyword-googlegroups.620...@mired.org> wrote: > > run the risk of fubaring some or all of the previous applications. > > That problem exists no matter how you do the configuration. But the > less per-application configuration you have to do, the les

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

2010-09-09 Thread lprefontaine
The major thing that made me used macros as much as possible when available in any language was writing assembly code. Not 100 lines projects, 20,000 and above, mainly made of macro calls. That's when you realize that you need to use macros to generate instructions for three reasons: a) keeping t

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 11:16:11 -0700 (PDT) Brenton wrote: > While evaluating Clojure, just remember, you don't have use it for > everything. When you need something simple, as in your examples, then > use cgi. When you need to do something more complex then Clojure can > help. The first problem wit

Re: Simple things should be simple

2010-09-09 Thread Saul Hazledine
On Sep 9, 8:16 pm, Brenton wrote: > > Even though Clojure doesn't already have what you are looking for it > would not be difficult to make it work. For example, you could create > a generic web app that would have an embedded REPL as well as the > ability to dynamically load code from external fi

Re: Simple things should be simple

2010-09-09 Thread Raoul Duke
On Thu, Sep 9, 2010 at 11:17 AM, Mike Meyer wrote: > That problem exists no matter how you do the configuration. But the > less per-application configuration you have to do, the less likely it > is to happen. (i might be not-quite-following, but) no, i think the problem i mentioned explicitly do

Re: Knowing in advance the complexity of count

2010-09-09 Thread Randy Hudson
Inexplicably (counted? "abcd") returns false. On Sep 9, 11:33 am, Sunil S Nandihalli wrote: > actually there is a function called > > counted? > > Sunil. > > On Thu, Sep 9, 2010 at 8:59 PM, Nicolas Oury wrote: > > Thank you very much. > > > Never looked closely at count definition. > > > I assum

Re: Simple things should be simple

2010-09-09 Thread Luke Renn
On Sep 9, 1:40 pm, Mike Meyer wrote: > The thing is, I'm evaluating clojure - that's what drags clojure into > it. What exactly are you evaluating Clojure for? Because unless it's teaching elementary school children, the LOC it takes to deploy a hello world webapp is irrelevant. Luke -- You

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

2010-09-09 Thread alux
Interesting discussion! I think about taking some of the topics into separate threads. Will see, I'm a bit under project pressure. Wont tell you the language ;( But, @Luc "pushing the advantage of Lisp macros to the forefront is not obvious if the audience cannot compare with another (good/simple

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 14:27:48 -0400 David Nolen wrote: > On Thu, Sep 9, 2010 at 2:17 PM, Mike Meyer < > mwm-keyword-googlegroups.620...@mired.org> wrote: > > > run the risk of fubaring some or all of the previous applications. > > That problem exists no matter how you do the configuration. But the >

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 11:48:36 -0700 (PDT) Saul Hazledine wrote: > On Sep 9, 8:16 pm, Brenton wrote: > > > > Even though Clojure doesn't already have what you are looking for it > > would not be difficult to make it work. For example, you could create > > a generic web app that would have an embedd

Re: clojure-contrib master now in submodules

2010-09-09 Thread Brian Carper
On Aug 20, 7:22 am, Stuart Sierra wrote: > If you want to use ALL contrib libraries, add a dependency on group > "org.clojure.contrib", artifact "complete", version "1.3.0-SNAPSHOT". > This meta-library depends on all other contrib libraries. This doesn't work because as was pointed out on IRC to

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

2010-09-09 Thread Daniel Werner
On 9 September 2010 07:31, Meikel Brandmeyer wrote: > derive works with non-qualified keywords, but the contract disallows > that: Apparently the contract given in the docstring is being enforced in derive's 2-arg definition, but the "must be namespaced" parts of the assertions are missing from t

Re: Simple things should be simple

2010-09-09 Thread Kevin Downey
just skimming the thread all I see is mention of war files, which, well, who cares? just get ring and the ring jetty adapter, you don't even after to presume the existence of an installed webserver or servlet container. http://github.com/hiredman/place-for-things is something I have been playing wi

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 12:04:34 -0700 (PDT) Luke Renn wrote: > On Sep 9, 1:40 pm, Mike Meyer 620...@mired.org> wrote: > > The thing is, I'm evaluating clojure - that's what drags clojure into > > it. > What exactly are you evaluating Clojure for? Because unless it's > teaching elementary school chil

Using a keyword as object get method

2010-09-09 Thread Sam Tingleff
I'm using thrift-generated Java objects heavily inside hadoop and it would be nice to access object properties using keyword notation instead of .getPropertyX. At platform speed of course. Searching the list shows someone else interested in the same thing but no answer. http://groups.google.com/g

Re: Simple things should be simple

2010-09-09 Thread Daniel Kersten
On 9 September 2010 19:16, Brenton wrote: > Mike, > > While evaluating Clojure, just remember, you don't have use it for > everything. When you need something simple, as in your examples, then > use cgi. When you need to do something more complex then Clojure can > help. > > You cannot deploy a .

Improved stack traces

2010-09-09 Thread Rich Hickey
People frequently complain about Clojure's stack traces, and there are now some enhancements in the master branch. In particular, there is a new function in clojure.repl, pst, which prints a nicer stack trace of the most recent (or a supplied) exception. It also has depth control. pst is automatica

Re: Simple things should be simple

2010-09-09 Thread Luke Renn
On Sep 9, 4:13 pm, Mike Meyer wrote: > Here I thought I could save time by choosing a nice, simple example > application that everyone would understand, rather than spending a lot > of time explaining (or abstracting out) irrelevant details of some > real-world application before asking the questi

Re: Simple things should be simple

2010-09-09 Thread Luke Renn
On Sep 9, 2:46 pm, Mike Meyer wrote: > I have to compile and link it first. Not a problem. My 3/0/1 solution > could just as well have been: > > $ cat - > hello.c > main() { >      puts("Content-type: text/plain\n\nHello world!\n") ; >      } > ^D > $ cc hello.c > $ cp a.out /usr/local/apache22/cg

Re: Improved stack traces

2010-09-09 Thread Alan
I assume I'm just clueless here, but the last commit I see at http://github.com/richhickey/clojure is one from Stuart Halloway in June. Where do I find this so I can try it out? Or, what version do I have to tell leiningen I depend on - 1.2.0-snapshot, 1.3.0-snapshot, or something like that? On Se

Re: Improved stack traces

2010-09-09 Thread Nicolas Oury
http://github.com/clojure/clojure -- 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 fr

drop-while and (pred item) returns nil?

2010-09-09 Thread Jacek Laskowski
Hi, According to drop-while doc, (pred item) will return nil. It struck me as I thought the form would only return a boolean. Is the doc correct? What would be an example? user=> (doc drop-while) - clojure.core/drop-while ([pred coll]) Returns a lazy sequence of the item

Re: Simple things should be simple

2010-09-09 Thread Lee Spector
On Sep 9, 2010, at 3:04 PM, Luke Renn wrote: > What exactly are you evaluating Clojure for? Because unless it's > teaching elementary school children, the LOC it takes to deploy a > hello world webapp is irrelevant. > > Luke >From the sidelines -- because I know little about web apps per se in

Re: Standalone 1.2 contrib

2010-09-09 Thread Stuart Sierra
Yes, it's in the ZIP file, distributed through http://clojure.org/downloads It's in the ZIP file at target/clojure-contrib-1.2.0.jar You can also download it directly at http://build.clojure.org/releases/org/clojure/clojure-contrib/1.2.0/clojure-contrib-1.2.0.jar Do we need a direct link to the

Re: clojure-contrib master now in submodules

2010-09-09 Thread Stuart Sierra
Can you clarify? Maven-aware build tools (e.g. Leiningen) should not be trying to downlaod the "clojure-contrib:complete" JAR file. Instead, referencing the "complete" project as a dependency should transitively give you all its dependencies. Does that not work? -S On Sep 9, 3:47 pm, Brian Ca

Re: Simple things should be simple

2010-09-09 Thread David Nolen
On Thu, Sep 9, 2010 at 5:53 PM, Lee Spector wrote: > > One of my favorite examples of making the simple stuff simple is Processing > (processing.org), which can be downloaded and installed with a single > click, and allows you to make an applet with the graphical equivalent of > HelloWorld with o

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 14:11:44 -0700 (PDT) Luke Renn wrote: > On Sep 9, 2:46 pm, Mike Meyer 620...@mired.org> wrote: > > I have to compile and link it first. Not a problem. My 3/0/1 solution > > could just as well have been: > > > > $ cat - > hello.c > > main() { > >      puts("Content-type: text/p

Re: clojure-contrib master now in submodules

2010-09-09 Thread Brian Carper
On Sep 9, 3:13 pm, Stuart Sierra wrote: > Can you clarify?  Maven-aware build tools (e.g. Leiningen) should not > be trying to downlaod the "clojure-contrib:complete" JAR file. > Instead, referencing the "complete" project as a dependency should > transitively give you all its dependencies.  Does

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

2010-09-09 Thread Miki
Boolean seems to work: user=> (drop-while #(< % 4) (range 10)) (4 5 6 7 8 9) user=> On Sep 9, 2:51 pm, Jacek Laskowski wrote: > Hi, > > According to drop-while doc, (pred item) will return nil. It struck me > as I thought the form would only return a boolean. Is the doc correct? > What would be

Re: Simple things should be simple

2010-09-09 Thread Rainer Schuster
no this discussion is going to be ... won't say it. Quiz: - is your solution functional (regarding the requirements= - is your solution scallable? (groing large or running plattformindependent?) - is your solution easily maintainable (in the sense of mutating it some days to get complex and have

  1   2   >