Map eats println output?

2011-10-17 Thread Walter van der Laan
Hi, When I run this expression: (map (fn [x] (println x) x) (range 5)) I expect to get (0 1 2 3 4) but instead I get (0 1 2 3 4 0 1 2 3 4) It seems like the println output is included in the result list. Am I missing something? -- You received this message because you are subscribed to the

Re: Map eats println output?

2011-10-17 Thread Baishampayan Ghose
When I run this expression: (map (fn [x] (println x) x) (range 5)) I expect to get (0 1 2 3 4) but instead I get (0 1 2 3 4 0 1 2 3 4) It seems like the println output is included in the result list. Am I missing something? The REPL is fooling you. (def *x (map (fn [x] (println x) x)

Re: Map eats println output?

2011-10-17 Thread Walter van der Laan
That's a big relieve. Thanks for the answer! -- 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

when quotes and when syntax-quotes?

2011-10-17 Thread Guofeng Zhang
Hi, I am reading Joy of Clojure, there is the following sample in 8.1.1: (defn contextual-eval [ctx expr] (eval `(let [~@(mapcat (fn [[k v]] [k `'~v]) ctx)] ~expr))) And the sample output: (contextual-eval {'a 1, 'b 2} '(+ a b)) ;= 3 (contextual-eval {'a 1, 'b 2} '(let [b 1000] (+ a

Re: ClojureScript Mobile BOF at the Clojure/conj?

2011-10-17 Thread Federico Brubacher
This seems interesting, if there's not a BOF let's meet informally anyway ! On Mon, Oct 17, 2011 at 1:40 AM, Frank Siebenlist frank.siebenl...@gmail.com wrote: Is there any interest to organize some form of ClojureScript Mobile BOF at the Clojure/conj? (some informal, ad hoc get-together

Re: ClojureScript Mobile BOF at the Clojure/conj?

2011-10-17 Thread Frank Siebenlist
The hotel bar may be a good backup venue ;-) On Oct 17, 2011, at 9:17 AM, Federico Brubacher wrote: This seems interesting, if there's not a BOF let's meet informally anyway ! On Mon, Oct 17, 2011 at 1:40 AM, Frank Siebenlist frank.siebenl...@gmail.com wrote: Is there any interest to

Is there a reader setting support BigDecimal by default?

2011-10-17 Thread Scott Hickey
In some versions of Scheme or Lisp, there is a flag that you can set so that the reader will create exact numbers by default (BigDecimal) instead of inexact doubles. Is there a way to do this in Clojure? Scott Hickey -- You received this message because you are subscribed to the Google

Re: when quotes and when syntax-quotes?

2011-10-17 Thread Marshall T. Vandegrift
Guofeng Zhang guof...@radvision.com writes: I do not understand why `'~v has be to used this way. If I used `~v instead (that is, remove the quote), it still works. So my question is, why ~v needs to be first quoted and then syntax-quoted? I'm not the most experienced Clojure programmer, but

Re: when quotes and when syntax-quotes?

2011-10-17 Thread Stephen Compall
On Mon, 2011-10-17 at 04:32 +, Guofeng Zhang wrote: `(let [~@(mapcat (fn [[k v]] [k `'~v]) ctx)] And the sample output: (contextual-eval {'a 1, 'b 2} '(+ a b)) I do not understand why `'~v has be to used this way. If I used `~v instead (that is, remove the quote), it still works.

Re: when quotes and when syntax-quotes?

2011-10-17 Thread Alan Malloy
On Oct 17, 12:50 pm, Marshall T. Vandegrift llas...@gmail.com wrote: Guofeng Zhang guof...@radvision.com writes: I do not understand why `'~v has be to used this way. If I used `~v instead (that is, remove the quote), it still works. So my question is, why ~v needs to be first quoted and

Re: Is there a reader setting support BigDecimal by default?

2011-10-17 Thread Meikel Brandmeyer
Hi, you are looking for 1.3M? Sincerely Meikel -- 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

Re: Is there a reader setting support BigDecimal by default?

2011-10-17 Thread Scott Hickey
I've been using 1.2 but I would be OK with a solution in any version. Scott Hickey -- 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

Re: Is there a reader setting support BigDecimal by default?

2011-10-17 Thread Meikel Brandmeyer
Hi, I meant this: Clojure 1.2.0 user= (type 1.0M) java.math.BigDecimal Sincerely Meikel -- 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 -

Get the name of keyword/symbol in clojurescript

2011-10-17 Thread Jonathan Fischer Friberg
Hi, As I understand it, clojurescript uses some unicode characters to identify keywords/symbols. I guess that's why (str 'a) gives me ï·‘'a I thought that this was intentional, and that (name 'a) would give me a, but I got the same result as with (str). So how do I extract the name from a symbol

Re: Get the name of keyword/symbol in clojurescript

2011-10-17 Thread David Nolen
Are you using ClojureScript HEAD? If you are and you are still seeing this under what conditions (advanced mode, browser REPL, etc.) ? David On Mon, Oct 17, 2011 at 6:41 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: Hi, As I understand it, clojurescript uses some unicode

trouble setting up emacs

2011-10-17 Thread Bruce Gordon
I am trying to follow the directions at http://dev.clojure.org/display/doc/Getting+Started+with+Emacs. 1. I want to install the Emacs Starter Kit. The directions at http://dev.clojure.org/display/doc/Getting+Started+with+Emacs mention GNU Emacs 23 or 24 is recommended, however

Re: trouble setting up emacs

2011-10-17 Thread Phil Hagelberg
On Mon, Oct 17, 2011 at 8:32 PM, Bruce Gordon brucebgor...@gmail.com wrote: I am trying to follow the directions at http://dev.clojure.org/display/doc/Getting+Started+with+Emacs. 1. I want to install the Emacs Starter Kit. The directions at

Presented 'Introduction to Clojure' at Silicon Valley Code Camp on October 8th

2011-10-17 Thread Abbas
Hi, I had the honor of doing a presentation on 'Introduction to Clojure' at Silicon Valley Code Camp on October 8th. It was the first presentation on Clojure at SVCC http://www.siliconvalley-codecamp.com/Sessions.aspx. The importance to Clojure could be felt being given the first time slot of