Re: Clojure's n00b attraction problem

2010-06-28 Thread Mike Meyer
"cageface" wrote: >The problem is that actually getting anything >done with Common Lisp is a nightmare. Libraries are sparse and >incompatible among implementations. Crucial things like FFI and >concurrency are non-standard. Interfacing with the rest of the world >is tedious. For the record, tha

Re: the joys of lisp

2010-06-29 Thread Mike Meyer
"Steve Molitor" wrote: >> The Python approach leads to more readable >>code: http://www.mired.org/home/mwm/papers/readability.html > >The two cases he sites do not apply to Clojure: More accurately, the problem being analyzed (a variable changing to a bad value) can't happen in clojure. It has

Re: Clojure's n00b attraction problem

2010-06-29 Thread Mike Meyer
"Tim Robinson" wrote: >* Most n00bs want a "hello world" in an application output (via script >or compojure). Not in a repl. The repl is a tool to get you there. In >order to do this users should really have a 7 step guide on leinington I happen to think that they're wanting the wrong thing. Eve

Re: Apply/Laziness question (was Re: Newb Question)

2010-06-29 Thread Mike Meyer
On Mon, 28 Jun 2010 13:31:45 -0500 Savanni D'Gerinel wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Along those lines, why is the apply necessary? > > More clearly, and I encountered this with a different block of code > earlier today, repeat returns a lazy sequence. Str does not

Re: Clojure's n00b attraction problem

2010-06-29 Thread Mike Meyer
On Tue, 29 Jun 2010 07:56:09 -0400 Lee Spector wrote: > > On Jun 29, 2010, at 1:05 AM, Mike Meyer wrote: > >> Yes emacs has built-in paren matching but emacs (like vi) is something > >> that has to be learned, not all newcomers will know it, I don't want > &

Re: Clojure's n00b attraction problem

2010-06-29 Thread Mike Meyer
On Tue, 29 Jun 2010 11:15:40 -0400 Lee Spector wrote: > > On Jun 29, 2010, at 10:26 AM, Mike Meyer wrote: > > Actually, have you looked at jedit? It's the only free Java editor > > that isn't trying to be an IDE. > > Thanks for this tip. I didn't know ab

Re: A capital point if we don't want to loose newbies "for free"

2010-06-29 Thread Mike Meyer
On Tue, 29 Jun 2010 20:54:28 +0200 Laurent PETIT wrote: > ... at least it's my opinion : we should stop consider newbies are as > excited as us by the idea of working with SNAPSHOT dependencies which > work day A, break day B. > > So I think we should have no SNAPSHOT dependencies in the Ge

Re: A capital point if we don't want to loose newbies "for free"

2010-06-29 Thread Mike Meyer
On Tue, 29 Jun 2010 23:12:54 +0200 Laurent PETIT wrote: > Now ... why do newbies want bleeding edge ? There certainly is a > reason for that. Honestly, if I were a newbie, currently on June 2010, > 29th, I certainly would like the bleeding edge, after having "heard" > so much goodness about protoc

Re: usage examples in clojure api docs

2010-06-29 Thread Mike Meyer
On Tue, 29 Jun 2010 17:01:10 -0700 (PDT) Mark Fredrickson wrote: > On Jun 29, 5:43 pm, nickikt wrote: > > We could make it possible to add some metadata to a function > > like :example or something. Then add a function called (example > > ) to print the example. > > > > Everybody could send patch

Re: Clojure's n00b attraction problem

2010-06-29 Thread Mike Meyer
On Wed, 30 Jun 2010 02:34:31 +0200 Michał Marczyk wrote: > On 29 June 2010 06:14, Michael Richter wrote: > > Ah.  The Clojure community has already started down the road to Common > > Lisp-style, smugness-generated obscurity and disdain.  Bravo!  Well-played! > Not at all. While we're discussing

Re: Clojure's n00b attraction problem

2010-06-29 Thread Mike Meyer
On Tue, 29 Jun 2010 20:02:14 -0700 (PDT) Jason Smith wrote: > If you want to get the length of a String in Clojure, you have to read > JavaDoc. Huh? bhuda% clj Clojure 1.1.0 user=> (count "abcd") 4 user=> (count "ab") 2 user=> If that's your view of clojure, no wonder you think it can't be us

Re: How to: an anonymous recursive function

2010-06-30 Thread Mike Meyer
On Tue, 29 Jun 2010 22:44:58 -0700 (PDT) Tim Robinson wrote: > So I am reading On Lisp + some blogs while learning Clojure (I know, > scary stuff :) > > Anyway, I've been playing around to see if I can get an anonymous > recursive function to work, but alas I am still a n00b and not even > sure

Re: Clojure's n00b attraction problem

2010-06-30 Thread Mike Meyer
Ok, my turn to contribute something more than just messages. Still just talking, though. http://www.mired.org/home/mwm/papers/simple-clojure.html is a writeup on how to get as much out of clojure as possible with a minimal amount of Java infrastructure knowledge. It's still a WIP, so feedback, co

Benchmarking clojure code

2010-07-01 Thread Mike Meyer
On [many an occasion] "Many people" wrote: > user=> (time foo) ... > "Elapsed time: 245.152 msecs" I hate to be a wet blanket, but how accurate is this? The doc doesn't even say whether it measures wall clock time or cpu time. Even if you knew that, it's at best a foundation to build a real b

Re: Benchmarking clojure code

2010-07-01 Thread Mike Meyer
On Thu, 1 Jul 2010 19:51:06 +0200 Peter Schuller wrote: > > Is anyone using anything more sophisticated than clojure.core/time for > > benchmarking clojure code? > > No, but last time I thought about this I figured a very simple > (benchmark ...) would simply: > > * Iterate with exponentially h

Re: Benchmarking clojure code

2010-07-01 Thread Mike Meyer
On Thu, 01 Jul 2010 15:21:03 -0400 "Hugo Duncan" wrote: > On Thu, 01 Jul 2010 13:44:25 -0400, Mike Meyer > wrote: > > > Is anyone using anything more sophisticated than clojure.core/time for > > benchmarking clojure code? > > I wrote a benchmarkin

Re: Benchmarking clojure code

2010-07-01 Thread Mike Meyer
On Thu, 1 Jul 2010 11:27:09 -0700 (PDT) j-g-faustus wrote: > On Jul 1, 7:51 pm, Peter Schuller wrote: > > > Is anyone using anything more sophisticated than clojure.core/time for > > > benchmarking clojure code? > Criterium, a benchmarking library for Clojure, seems pretty good: > http://github.c

Re: How to: an anonymous recursive function

2010-07-01 Thread Mike Meyer
On Thu, 1 Jul 2010 12:50:00 -0700 (PDT) Tim Robinson wrote: > and now corrected! > > (defmacro anaphoric-recur [parm-binds expr & parms] > "An anaphoric recursive function that takes a vector of blind >bindable vars, an expression that can handle the bindable vars. >and th

Re: Benchmarking clojure code

2010-07-01 Thread Mike Meyer
On Thu, 1 Jul 2010 23:39:16 -0400 Aaron Cohen wrote: > > If nothing else adding code to measure the empty loop and punting if > > the difference between that and the code loop is statistically > > insignificant would seem like a good idea. > It's actually notoriously hard to time the "empty loop"

Re: Benchmarking clojure code

2010-07-02 Thread Mike Meyer
On Thu, 1 Jul 2010 22:19:56 -0400 Greg wrote: > I don't see how the loop is relevant here, at least if the same benchmarking > function is used for all the benchmarks you're doing, it should make a > difference then since the overhead is the same. It depends on what you're benchmarking. If the

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

2010-07-02 Thread Mike Meyer
ment: returns argument -> 1 (reduce conj 1 []) ; Note that in the previous two examples, conj is not invoked, as it ; always returns a sequence. ; Edge case with no arguments: (*) -> 1 (reduce * []) ; Broken edge case: Wrong number of arguments passed to function: (reduce conj []) -- M

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

2010-07-02 Thread Mike Meyer
On Fri, 2 Jul 2010 14:50:18 -0700 (PDT) Justin Kramer wrote: > Nice, Mike. I stole your work and put it into the Wiki I created to > see how it fit: > > http://clojure-examples.appspot.com/clojure.core/reduce Well, I like it, but I might be a bit biased. I think the important part is the rules

Re: How to convert a list to arguments?

2010-07-04 Thread Mike Meyer
On Sun, 4 Jul 2010 20:21:22 -0700 (PDT) dennis wrote: > For example: > (max 1 2 3) => 3 > (max (list 1 2 3)) => (1 2 3) > > How to convert (list 1 2 3) to arguments for function? Sounds like you want apply: (apply max (list 1 2 3)) => 3 http://www.mired.org/consulting.html

Re: --> macro proposal

2010-07-06 Thread Mike Meyer
On Tue, 6 Jul 2010 14:09:18 -0400 Greg wrote: > On Jul 6, 2010, at 2:01 PM, Stuart Halloway wrote: > > (3) I haven't seen a lot of examples where something like --> solves real > > problems in code. > > I haven't coded long enough in Clojure to provide you with any examples, but > it seems like

Re: --> macro proposal

2010-07-06 Thread Mike Meyer
On Tue, 6 Jul 2010 16:16:37 -0400 Greg wrote: > > Have you checked for those? > > No, sorry, I think that's a rather unreasonable request. I'm not going to > spend hours sifting through the core and contrib just to jerk out examples > for you. > > I'd rather use logic and reason to make my ca

Re: Idiomatic Clojure namespace names

2010-07-07 Thread Mike Meyer
"Meikel Brandmeyer" wrote: >Hi, > >Am 07.07.2010 um 18:13 schrieb James Reeves: > >> - foo.core >> - com.github.weavejester.foo > >I would go with one of these two. At the moment I prefer the former. I think >putting domain names in the package is suboptimal for a quite simple reason. >I'm a h

Re: Idiomatic Clojure namespace names

2010-07-07 Thread Mike Meyer
"Meikel Brandmeyer" wrote: >Hi, > >Am 07.07.2010 um 21:41 schrieb Mike Meyer: > >> Why bother renaming it when you move? > >Why come into a situation where bothering is a question? You would have to ask the people at sun.com who created the convention that o

Re: Idiomatic Clojure namespace names

2010-07-07 Thread Mike Meyer
ly to collide with a DNS namespace, and 2) isn't likely to be used by any other language. Given that Sun is using javax, something like "clojure.(author).(project)" would seem to be appropriate. That should be safe from the DNS namespace (unless it means something when transliterat

Re: Idiomatic Clojure namespace names

2010-07-08 Thread Mike Meyer
On Thu, 8 Jul 2010 07:15:45 -0700 (PDT) Meikel Brandmeyer wrote: > Hi, > > On Jul 8, 7:25 am, j-g-faustus wrote: > > > So maybe it's best to use the Java convention after all? > > It has been proven to scale, is widely used and plays well with > > whatever else is running on the JVM, which are

Re: Idiomatic Clojure namespace names

2010-07-08 Thread Mike Meyer
On Thu, 8 Jul 2010 09:22:01 -0700 Phil Hagelberg wrote: > On Thu, Jul 8, 2010 at 7:15 AM, Meikel Brandmeyer wrote: > >> So maybe it's best to use the Java convention after all? > >> It has been proven to scale, is widely used and plays well with > >> whatever else is running on the JVM, which ar

Re: Idiomatic Clojure namespace names

2010-07-08 Thread Mike Meyer
On Thu, 8 Jul 2010 21:29:56 +0200 Meikel Brandmeyer wrote: > Hi, > > Am 08.07.2010 um 18:52 schrieb Mike Meyer: > > > People seem to be confused by the Java namespace convention deriving > > names from DNS. They think that the names actually have something to &g

Re: Idiomatic Clojure namespace names

2010-07-08 Thread Mike Meyer
"Armando Blancas" wrote: >> Personally, I trust the inventors of the convention more than people >> running a single project. But that begs two questions: how do they >> define "ownership" of a domain, > >Sounds like common usage; e.g. as the owner of mired.org you get to >use it as groupId. So

Re: Idiomatic Clojure namespace names

2010-07-08 Thread Mike Meyer
"Armando Blancas" wrote: >> So they wouldn't object if I wanted to use my wordpress or sourceforge >> domains? > >If I understand this correctly, they wouldn't: > >http://maven.apache.org/guides/mini/guide-central-repository-upload.html By my reading, they would. A wordpress domain is simply ou

Re: Idiomatic Clojure namespace names

2010-07-09 Thread Mike Meyer
On Fri, 9 Jul 2010 03:01:01 -0700 (PDT) Jeff Rose wrote: > I've asked myself this same question 50 times now. My best experience > so far with a community that had packages was Ruby, and it was > incredibly simple. Everyone can choose whatever name they like for > their package as long as it is

Bug in 1-arg max/min implementation? (Was: Should max and min have 0-arg implementations?)

2010-07-09 Thread Mike Meyer
On Fri, 9 Jul 2010 13:57:05 -0400 Stuart Halloway wrote: > Once you walk down the path of "What should (max) return?" I think you won't > want a default behavior. > > Stu > > P.S. Agreed that (max []) is a bad example. Given that max only works on numbers, then why doesn't (max []) throw the

Re: Idiomatic Clojure namespace names

2010-07-09 Thread Mike Meyer
On Fri, 9 Jul 2010 19:14:00 +0100 James Reeves wrote: > On 8 July 2010 16:56, Chas Emerick wrote: > > Clojars is a disaster as an authoritative software artifact repository IMO, > > and nothing about how it's being used should be taken as a template for > > anything else. > Ruby and Rubygems has

Re: Idiomatic Clojure namespace names

2010-07-09 Thread Mike Meyer
On Fri, 9 Jul 2010 12:49:05 -0700 (PDT) j-g-faustus wrote: > That said, I would leap at a chance to shorten Java names, even if it > were just to chop off the leading "com" or "org". As the owner of mired.org, but not of mired.com (and I don't know the registered owner) or .net, or of that domain

Re: Idiomatic Clojure namespace names

2010-07-10 Thread Mike Meyer
"Saul Hazledine" wrote: >On Jul 10, 12:16 am, Mike Meyer 620...@mired.org> wrote: >> On Fri, 9 Jul 2010 12:49:05 -0700 (PDT) >> >> j-g-faustus wrote: >> > That said, I would leap at a chance to shorten Java names, even if it >> > were just

Re: Idiomatic Clojure namespace names

2010-07-10 Thread Mike Meyer
On Sat, 10 Jul 2010 03:42:16 -0700 (PDT) Jeff Rose wrote: > On Jul 9, 6:22 pm, Mike Meyer 620...@mired.org> wrote: > > How have you managed to miss the second half of "that's the way they > > do it in Java", which is "and we need to interoperate with other J

Re: A DSL for writing scripts which have restricted memory and cpu usage

2010-07-13 Thread Mike Meyer
On Tue, 13 Jul 2010 08:29:00 +0200 "Heinz N. Gies" wrote: > > On Jul 13, 2010, at 2:44 , Folcon wrote: > > > > > > > On Jul 13, 1:36 am, ngocdaothanh wrote: > >>> Are there any ways to restrict how many resources a user has access to? > >> > >> If you use Linux, you see /etc/security/limits

Re: Executable clojure scripts (#!/usr/bin/env clj)

2010-07-13 Thread Mike Meyer
On Tue, 13 Jul 2010 21:55:15 +0100 Paul Richards wrote: > I'm new to Clojure, and I've found it possible to make Clojure scripts > executable by adding '#!/usr/bin/env clj' as the first line (and > 'chmod +x' of course). > > E.g. My sample script: > > #!/usr/bin/env clj > > (println "Hello Wor

Re: Clojure noob: refactoring factorial code

2010-07-15 Thread Mike Meyer
On Thu, 15 Jul 2010 04:38:22 -0700 (PDT) Brisance wrote: > Here's a factorial function as found in the WikiBook "Learning > Clojure" : > > (defn factorial [n] > (defn fac [n acc] > (if (zero? n) >acc > (recur (- n 1) (* acc n

Re: Clojure noob: refactoring factorial code

2010-07-16 Thread Mike Meyer
"James Reeves" wrote: >On 15 July 2010 16:24, Brisance wrote: >> Thanks for the response. >> >> To get an idea of what I mean,  visit http://www.wolframalpha.com/''. >> Then enter something ridiculous (to me, at least) like 10! >> >> The answer is almost instantaneous. > >Wolfram Alpha is me

Patch to make leiningen at least try to be portable...

2010-07-19 Thread Mike Meyer
echo "The upgrade task is only meant for stable releases." echo "See the \"Hacking\" section of the README." exit 1 -- Mike Meyer http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more

Re: Memoizing tree recursive calls

2010-07-21 Thread Mike Meyer
On Tue, 20 Jul 2010 13:11:12 -0700 (PDT) Aravindh Johendran wrote: > If we have tree recursive procedure such as the follows, how can we > use memoize it so that it automatically caches the values it has > already computed . [example elided] > Maybe memoize should go the same way as the co

Re: Memoizing a recursive function?

2010-07-22 Thread Mike Meyer
On Wed, 21 Jul 2010 14:47:12 -0700 (PDT) logan wrote: > Lets say I have the following function > > (defn fib[n] > (if (> n 2) > (+ (fib (- n 2)) (fib (- n 1))) > 1)) > > and I want to memoize it, what is the right way to do it? Use defn-memo from clojure.contrib.def.

Re: Memoizing a recursive function?

2010-07-23 Thread Mike Meyer
[Context lost to top posting.] On Thu, 22 Jul 2010 15:56:32 -0700 (PDT) logan wrote: > I tried defn-memo .. it still does not appear to memoize the original > fib call? I tried this using clojure 1.2 beta. Reading the code > definition for defn-memo it seems like it should work, but calling > (f

two-way expression insertion?

2010-07-31 Thread Mike Meyer
Given all the ways that values can be inserted into multiple expressions: doto, ->, ->> and .., I was surprised that I couldn't find one that would handle this case: (.setEnabledCipherSuites socket (.getSupportedCipherSuites socket)) I would expect this to be common: I want to invoke a meth

Re: 2 links for beginners

2010-08-03 Thread Mike Meyer
On Tue, 3 Aug 2010 07:28:39 -0700 (PDT) nickikt wrote: > The artical is really good for people you like to jump in headfirst. > I'm more of a book first guy but I told my, soon to be Clojure > Programmer :) , friend about that article. > > Thats why nobody likes (liked) the Lisp compunity. > Rea

Re: System calls

2010-08-09 Thread Mike Meyer
On Mon, 9 Aug 2010 09:37:14 -0700 (PDT) Dave wrote: > Thanks jf, that worked: > > (ns msms > (:gen-class) > (:use [clojure.contrib.shell-out :only (sh)])) > > (defn get-msms-pts-OSX > [{pdb-file :pdb-file density :density radius :radius :as all :or > {density "1.0" radius "1.5"}}] > (if

Re: M-x clojure-mode in Slime REPL disables REPL

2010-08-10 Thread Mike Meyer
On Tue, 10 Aug 2010 09:57:02 -0700 (PDT) Alexis Rondeau wrote: > What I would like to do is to enable clojure-mode when I get my REPL > (connected either via swank-clojure-project or lein swank/M-x slime- > connect) but whenever I do M-x clojure-mode, the REPL stops (I think) > evaluating. While t

Re: More urgency for CinC & CLR given Oracle's lawsuit against Google?

2010-08-13 Thread Mike Meyer
-Machine VM or a SmallTalk VM (Squeak, maybe?) - which Gosling cites as inspirations for the JVM (2) - such suits are clearly baseless, as the technology is obviously prior art. So it can't infringe the patent, only invalidate it. http://queue.acm.org/detail.cfm?id=1017013

Re: What is the reason Lisp code is not written with closing parenthesis on new lines?

2010-08-18 Thread Mike Meyer
On Wed, 18 Aug 2010 22:48:07 -0400 Paul Stadig wrote: > Then I move on to thinking it best for a language designer to just legislate > fomatting and make it a compiler error, but that would probably generate > more discussion than otherwise, so I've just written the whole thing off as > a lose-los

Re: Basic colour in the standard REPL

2010-08-27 Thread Mike Meyer
On Fri, 27 Aug 2010 04:09:31 -0700 (PDT) frou wrote: > Is it or would it be possible to add some basic text colouring to the > standard REPL (the one started with the "clj" shell script). > > It would be nice to be able to make the prompt, e.g. "user=>" coloured > (green in my case) so that you

Re: doto

2010-08-27 Thread Mike Meyer
On Fri, 27 Aug 2010 13:39:34 -0700 (PDT) cej38 wrote: > I don't understand doto. Apparently. The doc says: user> (doc doto) - clojure.core/doto ([x & forms]) Macro Evaluates x then calls all of the methods and functions with the value of x supplied at the from of the

Re: misunderstanding collection

2010-08-28 Thread Mike Meyer
On Sat, 28 Aug 2010 12:23:04 -0400 John Newman wrote: > A reader macro for destructuring might be nifty, like #[...]. I don't think so. But first, we already have an "on-demand" destructuring facility: let. > So you could do things like: > > (#(map (partial reduce +) #a b c][d e f]]] %])

Re: misunderstanding collection

2010-08-28 Thread Mike Meyer
On Sat, 28 Aug 2010 18:11:41 -0400 John Newman wrote: > > #%3 %2 %1][%4 %5 %6]]] signal] -> [c b a d e f] > > Right, the names are superfluous. So are the extra set of brackets I > guess. Perhaps even better would be: > > (#[[_ _ _][_ _ _]] signal) > > Or if you wanted just the third ite

Re: Lisp/Scheme Style Guide

2010-08-31 Thread Mike Meyer
On Tue, 31 Aug 2010 15:40:10 -0600 "Eric Schulte" wrote: > I apologize for apparently re-opening some fresh wounds. > > I wasn't trying to assert that these guidelines should be universally > adopted or enforced. > > There are a number of conventions that exist for writing lisp, and I > thought

Re: Lisp/Scheme Style Guide

2010-08-31 Thread Mike Meyer
On Tue, 31 Aug 2010 15:41:13 -0700 Greg wrote: > On Aug 31, 2010, at 2:35 PM, fin wrote: > > >> The concept of the One-Style-To-Rule-Them-All is just childish. > > > > Have you read "Style is Substance"? > > http://www.artima.com/weblogs/viewpost.jsp?thread=74230 > > No, I hadn't, thanks for t

Re: multiple parameters passed to fns

2010-09-02 Thread Mike Meyer
(apply identity collated-target1)] collated-target2)) ([file channel sweepidx startidx] (drop startidx (make-target file channel sweepidx))) ([file channel sweepidx startidx size] (take size (make-target file channel sweepidx startidx -- Mike Meyer http:

Re: Extending Clojure's STM with external transactions

2010-09-02 Thread Mike Meyer
On Wed, 1 Sep 2010 15:14:45 -0700 (PDT) Alyssa Kwan wrote: > I'll go one step further and say that we shouldn't have to call > "persist namespace". It should be automatic such that a change to the > state of an identity is transactionally written. > > Let's start with refs. We can tackle the o

Re: external clojure lib >

2010-09-07 Thread Mike Meyer
On Tue, 7 Sep 2010 08:36:27 -0700 (PDT) Abraham wrote: > still i am not getting , i meant to say that , i want to use > clojure.contrib. libraries , how to make it work with my system . from > where this lib has to copied and which directory to copy... > may be lib is clj's files As other have p

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

2010-09-08 Thread Mike Meyer
On Wed, 08 Sep 2010 15:13:57 -0400 (EDT) lprefonta...@softaddicts.ca wrote: > I cannot help you much here. I looked at Scala nearly two years ago while > searching for a JVM alternative to Java. I already knew Lisp and wanted > a generic macro facility but I was not convinced by Scala even before >

Re: REPL

2010-09-08 Thread Mike Meyer
On Wed, 8 Sep 2010 11:26:38 -0700 (PDT) Sean wrote: > Hi, > > I'm new to Clojure. This is also my first time posting here. > When I use REPL and print something out, I always get a nil printed. > For example, (print "Clojure"), I got: clojurenil. Where does the nil > come from? REPL stands for

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 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 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 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 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

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

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: 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*

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: 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

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 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 ne

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 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

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: 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

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 > > mai

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 14:01:19 -0700 (PDT) Luke Renn wrote: > On Sep 9, 4:13 pm, Mike Meyer 620...@mired.org> wrote: > > Here I thought I could save time by choosing a nice, simple example > > application that everyone would understand, rather than spending a lot > >

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 14:20:29 -0700 (PDT) Rainer Schuster wrote: > no this discussion is going to be ... won't say it. > > Quiz: > > - is your solution functional (regarding the requirements= Yes. > - is your solution scallable? (groing large or running > plattformindependent?) It will run on

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Thu, 9 Sep 2010 16:06:54 -0700 (PDT) Luke Renn wrote: > That was kind of my point. I would expect these kinds of questions, > examples, and objections from someone looking at Clojure/Ring to teach > with, not necessarily someone who want to deploy highly scalable web > applications. I'm curio

Re: Simple things should be simple

2010-09-09 Thread Mike Meyer
On Fri, 10 Sep 2010 01:08:06 -0400 John Newman 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" > > 4/0/0

Re: Simple things should be simple

2010-09-10 Thread Mike Meyer
On Fri, 10 Sep 2010 00:03:22 -0700 (PDT) Meikel Brandmeyer wrote: > Hi, > > On 9 Sep., 20:46, Mike Meyer 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'

Re: Simple things should be simple

2010-09-10 Thread Mike Meyer
On Fri, 10 Sep 2010 07:11:18 -0700 gary ng wrote: > On Fri, Sep 10, 2010 at 4:47 AM, John Cromartie 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 conso

Re: Simple things should be simple

2010-09-10 Thread Mike Meyer
On Fri, 10 Sep 2010 23:21:01 +0200 Meikel Brandmeyer 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 conte

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 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 deploy, and Unix does

Re: thinking in clojure

2010-09-16 Thread Mike Meyer
On Wed, 15 Sep 2010 11:48:09 -0700 Michael Ossareh wrote: > Hi Guys, > > One of the things that has struck me about clojure, by virtue of being > a lisp, is the concision of the code - I really find it very > attractive. However yesterday I found something that I couldn't work > out how to do in

Re: trace facility?

2010-09-19 Thread Mike Meyer
On Sun, 19 Sep 2010 16:33:54 -0700 (PDT) TimDaly wrote: > In common lisp I can say (trace foo) and it will print out the > arguments > and the return value of calls to foo. Would it be possible to create > such > a facility in clojure, perhaps by defining a new class loader? Java > knows > the ty

Re: Fighting with Emacs ;-)

2010-09-28 Thread Mike Meyer
On Tue, 28 Sep 2010 03:58:56 -0700 (PDT) psfblair wrote: > I could do this, but right now I'm just playing with C-c C-r to > evaluate regions, instead of compiling the entire file. And I'd swear > this used to put the evaluation in the REPL. > > On Sep 27, 10:59 pm, Alan wrote: > > C-c C-k in t

Re: Cross-referencing objects?

2010-10-03 Thread Mike Meyer
On Sun, 3 Oct 2010 00:32:16 -0700 (PDT) Alan wrote: > I've got a collection of unique objects, and I need to partition them > into sets. That part's easy enough, but I need to have both of the > following be efficient, and preferably easy: > - Given an object, determine what set it's in > - List

Re: Trouble understanding let

2010-10-09 Thread Mike Meyer
"Andreas Kostler" wrote: >From "Programming Clojure", Chapter 2 - Bindings: >"The bindings are then in effect for exprs, and the value of the let >is the value of the last expression in exprs." >To me this reads: >user=> (let [k (+ 2 2)]) > 4 > >However, repl says: >user=> (let [k (+ 2 2)]) >

Re: How to Sum a Sequence?

2011-03-21 Thread Mike Meyer
On Sun, 20 Mar 2011 08:47:30 -0700 (PDT) Christian wrote: > Hello Tassilo! > > I've tested your code and looked at the Clojure Documentation for > 'for'. Given that, I have written > > (reduce +(filter even? (for [fib (fib-seq) :while (< fib 400)] > fib))) > > This gives me the error 'cloj

<    1   2   3   4   >