Re: Bug in clojure.contrib.core/-?> (improper quoting?)

2010-12-07 Thread Ken Wesson
On Wed, Dec 8, 2010 at 1:08 AM, Jason Wolfe wrote: >> Posting a reply to someone that consists solely of a link that, when >> accessed by that someone, throws up an access denied message in their >> face, is an equivalent act to sending them an encrypted reply for >> which they don't have the key,

Re: Bug in clojure.contrib.core/-?> (improper quoting?)

2010-12-07 Thread Jason Wolfe
> Posting a reply to someone that consists solely of a link that, when > accessed by that someone, throws up an access denied message in their > face, is an equivalent act to sending them an encrypted reply for > which they don't have the key, or handing them a locked briefcase for > which they don

Re: Bug in clojure.contrib.core/-?> (improper quoting?)

2010-12-07 Thread Ken Wesson
On Wed, Dec 8, 2010 at 12:02 AM, Stuart Halloway wrote: > The permissions were not set correctly for anonymous read access. I have > changed them, you should be able to get there now: > http://dev.clojure.org/jira/browse/CONTRIB-102. Ah, so there was indeed a technical snafu. Glad that's cleare

Re: Giving a 15 minute Clojure lightning talk. Any ideas?

2010-12-07 Thread Tim Daly
Ask Rich if you can use his Ants example. His comment about running it on the Azul(?) machine is interesting. On 12/7/2010 7:56 PM, Alex Baranosky wrote: Hi guys, I'm going to be doing a 15 minute Clojure lighting talk in a few weeks for work. I've been having trouble finding a nice topic fo

Re: Bug in clojure.contrib.core/-?> (improper quoting?)

2010-12-07 Thread Stuart Halloway
The permissions were not set correctly for anonymous read access. I have changed them, you should be able to get there now: http://dev.clojure.org/jira/browse/CONTRIB-102. Effective communication tip: Please preserve links in responses, so that when somebody is trying to track down issues they

Re: Bug in clojure.contrib.core/-?> (improper quoting?)

2010-12-07 Thread Ken Wesson
On Tue, Dec 7, 2010 at 10:53 PM, Alan wrote: > Link works fine. Does it? > You have to be logged in Then, in my opinion, it does NOT work fine. I should be able to VIEW anything non-confidential without logging in, though I expect to possibly have to login to POST stuff. (And if something IS co

Re: Giving a 15 minute Clojure lightning talk. Any ideas?

2010-12-07 Thread Jeff Heon
Hi Alex, The first part of these slides covers Ruby / Clojure syntax and might be useful: http://www.slideshare.net/jfheon/clojure-forrubyists Break a leg ;) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojur

Re: Bug in clojure.contrib.core/-?> (improper quoting?)

2010-12-07 Thread Alan
Link works fine. You have to be logged in (this is a point of contention, I think). On Dec 7, 6:58 pm, Ken Wesson wrote: > On Tue, Dec 7, 2010 at 3:05 PM, Jason Wolfe wrote: > >http://dev.clojure.org/jira/browse/CONTRIB-102 > > Link doesn't work. It goes to a login prompt and not to ... well, >

Re: Lots of newbie clojure questions

2010-12-07 Thread Ken Wesson
On Tue, Dec 7, 2010 at 12:28 PM, Mike Meyer wrote: > On Tue, 7 Dec 2010 02:58:11 -0500 > Ken Wesson wrote: >> On Tue, Dec 7, 2010 at 2:15 AM, javajosh wrote: >> > Mike also points out that things that aren't functions (not used in >> > that context) can't be aliased with def or use. >> >> Really

Re: Bug in clojure.contrib.core/-?> (improper quoting?)

2010-12-07 Thread Ken Wesson
On Tue, Dec 7, 2010 at 3:05 PM, Jason Wolfe wrote: > http://dev.clojure.org/jira/browse/CONTRIB-102 Link doesn't work. It goes to a login prompt and not to ... well, whatever you intended it to go to. -- You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: advantage of clojure over non lisp languages

2010-12-07 Thread Ken Wesson
On Tue, Dec 7, 2010 at 6:57 PM, Alan wrote: > I remember I was very excited about Java 1.5 when it came out, because > of all the syntactic sugar it provided. I was tired of typing > > for (int i = 0; i < foo.length; i++) { >    Bar b = foo[i]; >    // do stuff with b > } > > 1.5 introduced the fo

Re: Giving a 15 minute Clojure lightning talk. Any ideas?

2010-12-07 Thread javajosh
The three things that I've seen that impressed me (and I'm a newb) were: 1. Swing GUI construction. Clojure's psuedo "with" syntax makes it very elegant. 2. Multi-threaded ant simulation. Although, I might try to do something simpler. 3. Numerical calculations. The fact that Clojure uses arbitrary

Re: Giving a 15 minute Clojure lightning talk. Any ideas?

2010-12-07 Thread Jay Fields
Getting started with clojure via clojure.test would probably be practical for getting people to try it out. Especially ruby people (who generally put more than average emphasis on testing). Sent from my iPhone On Dec 7, 2010, at 7:56 PM, Alex Baranosky wrote: > Hi guys, > > I'm going to be

Re: ANN: Dr. Evil - the evil web debugger

2010-12-07 Thread Miki
> > Comments/criticism/improvements welcomed. > > "EVIL" doesn't have to be a macro. You could just make it a function: > > (defn EVIL [path] >   (GET path [expr] >     (if (nil? expr) >       (html path) >       (json-str (eval-expr expr Right you are kind Sir. Pushed to clojars. -- You rec

Giving a 15 minute Clojure lightning talk. Any ideas?

2010-12-07 Thread Alex Baranosky
Hi guys, I'm going to be doing a 15 minute Clojure lighting talk in a few weeks for work. I've been having trouble finding a nice topic for 15 minutes, mostly because it is too short of a time to cover a wide array of... anything. The audience does Java / Ruby so I am concerned about the syntax

Re: Bug in clojure.contrib.core/-?> (improper quoting?)

2010-12-07 Thread Jason Wolfe
Great, thanks! -Jason On Dec 7, 2:52 pm, Laurent PETIT wrote: > Will provide a patch soon, > > thanks for the bug report > > 2010/12/7 Jason Wolfe > > > > > On Dec 6, 8:41 pm, Ken Wesson wrote: > > > On Mon, Dec 6, 2010 at 10:27 PM, Jason Wolfe > > wrote: > > > > This happens in both Clojure

Re: advantage of clojure over non lisp languages

2010-12-07 Thread Alan
I remember I was very excited about Java 1.5 when it came out, because of all the syntactic sugar it provided. I was tired of typing for (int i = 0; i < foo.length; i++) { Bar b = foo[i]; // do stuff with b } 1.5 introduced the foreach loop syntax, so that I could instead write for (Bar

Re: advantage of clojure over non lisp languages

2010-12-07 Thread Alex Baranosky
There are plenty of things that can be done with macros, that cannot be done in Scala or Java. I can't find an example off hand, but the books: The Joy of Clojure, Clojure in Action, and Programming Clojure have good examples throughout. -- You received this message because you are subscribed to

advantage of clojure over non lisp languages

2010-12-07 Thread SpiderPig
Hi, I was wondering if there are any good examples that show what advantages clojure/lisp has over most other programming languages. I mean a piece of code that couldn't be easily translated into e.g. scala or java. A program that would take much longer to develop in other languages due to the uniq

Re: Bug in clojure.contrib.core/-?> (improper quoting?)

2010-12-07 Thread Laurent PETIT
Will provide a patch soon, thanks for the bug report 2010/12/7 Jason Wolfe > > > On Dec 6, 8:41 pm, Ken Wesson wrote: > > On Mon, Dec 6, 2010 at 10:27 PM, Jason Wolfe > wrote: > > > This happens in both Clojure 1.2 and 1.3-latest: > > > > > user=> (require 'clojure.contrib.core) > > > nil > >

Re: mapmap?

2010-12-07 Thread javajosh
On Dec 7, 5:50 am, Sean Devlin wrote: > This is a solved problem.  The trick is to use a higher-higher order > function... > > http://fulldisclojure.blogspot.com/2010/01/12-fn-proposal-same-multis... Why not call it "unseq"? -- You received this message because you are subscribed to the Googl

Re: Bug in clojure.contrib.core/-?> (improper quoting?)

2010-12-07 Thread Jason Wolfe
On Dec 6, 8:41 pm, Ken Wesson wrote: > On Mon, Dec 6, 2010 at 10:27 PM, Jason Wolfe wrote: > > This happens in both Clojure 1.2 and 1.3-latest: > > > user=> (require 'clojure.contrib.core) > > nil > > user=> (clojure.contrib.core/-?> 1 inc) > > 2 > > user=> (clojure.contrib.core/-?> 1 inc inc)

Re: a macro to debug the let form

2010-12-07 Thread Alan
I see you have defined a print-and-return macro; you might prefer my and-print: (defmacro and-print "A useful debugging tool when you can't figure out what's going on: wrap a form with and-print, and the form will be printed alongside its result. The result will still be passed along." [va

Re: Lots of newbie clojure questions

2010-12-07 Thread Mike Meyer
On Tue, 7 Dec 2010 02:58:11 -0500 Ken Wesson wrote: > On Tue, Dec 7, 2010 at 2:15 AM, javajosh wrote: > > Mike and I have had a nice off-line conversation where we enumerated > > the possible things that can come after open-parens. I listed 7, he > > added 3: That wasn't meant to be offline, bu

Re: Lots of newbie clojure questions

2010-12-07 Thread Meikel Brandmeyer
Hi, Am 07.12.2010 um 08:58 schrieb Ken Wesson: > The ns macro is particularly > guilty of this. I say guilty because I think it's bad design, which I > guess may have been grandfathered in before the standard was settled > on to use [] around non-executable lists of data such as binding > lists.

Re: mapmap?

2010-12-07 Thread pepijn (aka fliebel)
If you use (empty m) rather than {} it will also work for other types. On Dec 7, 5:45 am, Ken Wesson wrote: > This is also very easy to implement: > > (into {} >   (for [[k v] the-map] >     [k (f v)])) > > e.g. > > user=> (into {} >   (for [[k v] {:a 3 :b 7}] >     [k (inc v)])) > {:a 4, :b 8} >

Re: There is no such thing as IAtom

2010-12-07 Thread pepijn (aka fliebel)
Thanks all. How would I do this protocol extension thing? My guess is that I need to define the IAtom protocol myself, and then do something like this? (defprotocol IAtom (compare-and-set! []) ...) (extend-type clojure.lang.Atom IAtom (compare-and-set! []) ... IDeref (deref [])) B

Re: mapmap?

2010-12-07 Thread Sean Devlin
This is a solved problem. The trick is to use a higher-higher order function... http://fulldisclojure.blogspot.com/2010/01/12-fn-proposal-same-multisame.html On Dec 7, 7:38 am, Daniel Janus wrote: > While on the topic, I'd like to raise a naming issue. > > The 'mapmap' function seems to be a re

Re: mapmap?

2010-12-07 Thread Ken Wesson
On Tue, Dec 7, 2010 at 3:31 AM, Tobias Raeder wrote: > Just checking performance versus the version i have been using i > noticed quite a difference > > For 10 runs over a small 10 key/value map > (defn fmap [keyf valf m] >  (into {} >    (for [[k v] m] >      [(keyf k) (valf v)]))) > 550ms >

Re: Creating map from string

2010-12-07 Thread Anclj
Thanks a lot for all the answers :) I've been busy trying to understand all the scripts that you posted. The code works but I also wanted to know why. I'm new to Clojure and it's hard for me to understand "advanced code", but looking through the docs and the api I'm learning a lot. Cheers! On 4

Re: mapmap?

2010-12-07 Thread Tobias Raeder
Just checking performance versus the version i have been using i noticed quite a difference For 10 runs over a small 10 key/value map (defn fmap [keyf valf m] (into {} (for [[k v] m] [(keyf k) (valf v)]))) 550ms (defn fmap2 [keyf valf m] (-> (fn [inputmap [k v]] (assoc inp

Re: mapmap?

2010-12-07 Thread Daniel Janus
While on the topic, I'd like to raise a naming issue. The 'mapmap' function seems to be a recurring theme (see, e.g., http://tech.puredanger.com/2010/09/24/meet-my-little-friend-mapmap/) and many Clojure projects include one -- Incanter comes to mind. My project used to, too. But we found out that

Re: [OT] ASF loses Java showdown vote to Oracle

2010-12-07 Thread Mikhail Kryshen
I don't think it will affect Clojure and OpenJDK communities much. Apache always wanted to have a certified Java implementation under permissive license. They probably get sponsor money for not using copyleft licenses like GPL [1]. Also, I recommend the recent talk by James Gosling on Apple, Apac

Re: ASF loses Java showdown vote to Oracle

2010-12-07 Thread lprefontaine
I would not be surprised if some regulatory agency (UE) puts it's nose in this if it has real impacts. Especially if Oracle does not abide by previous agreements with the Open Source community. If a regulator sanctions Oracle, others will follow most likely. If Oracle wants to be the next Micros

Re: Lots of newbie clojure questions

2010-12-07 Thread James Reeves
On 7 December 2010 09:22, javajosh wrote: > Anyway, I'm aware that open-parens is the signal to Invoke or Call > something in Clojure - and therefore anything after the parens is > Callable. It is the incredible diversity of 'Things I Can Invoke' that > makes the parens difficult to a newb. (Altho

Re: ASF loses Java showdown vote to Oracle

2010-12-07 Thread Shantanu Kumar
On Dec 7, 12:00 pm, Baishampayan Ghose wrote: > Hello, > > http://www.theregister.co.uk/2010/12/07/apache_google_vote_no_oracle_...http://news.ycombinator.com/item?id=1977720 > > Does this mean anything for Clojure (on the JVM)? As an interesting aside, here is the details on JCP votes: http://

Re: Lots of newbie clojure questions

2010-12-07 Thread Ken Wesson
On Tue, Dec 7, 2010 at 4:22 AM, javajosh wrote: > As an aside, it would be nice if there was some code convention to > distinguish between macros and functions, just as there is a > convention for identifying globals. (doc something) gets to be rather > tedious to type. +1, with two provisos: spe

Re: Lots of newbie clojure questions

2010-12-07 Thread javajosh
On Dec 6, 11:58 pm, Ken Wesson wrote: > On Tue, Dec 7, 2010 at 2:15 AM, javajosh wrote: > > Mike and I have had a nice off-line conversation where we enumerated > > the possible things that can come after open-parens. I listed 7, he > > added 3: > > >> 1. A value (if the paren has a tick '(  ) >

Re: Why I'm getting StackoverflowError?

2010-12-07 Thread Meikel Brandmeyer
Hi, Am 06.12.2010 um 22:38 schrieb Ken Wesson: > A reduce that discards one of its arguments (e.g. (reduce (fn [n _] > (inc n)) coll)) also strikes me as slightly icky. :) Indeed this would fit in the 5% left. Anyway: I can't remember writing a function with accumulator not using the other argu

Re: Lots of newbie clojure questions

2010-12-07 Thread Alyssa Kwan
Incidental mutability is the key. Functional programming doesn't eliminate mutability, it manages it: only the parts of the system that truly need to change state do so. Everything else is pure and easy to write and test. Contrast that with imperative programming where it's hard to tell which s