Hi, 
try 

(set (for [x (range 4)] (* x 4)))

Cheers
Andreas

On 24/05/2011, at 8:40 PM, MarisO wrote:

> Is it possible to use list comprehension to generate a set ?
> For example in scala I can do:
> 
> for (i <- (2 to 8).toSet[Int]) yield p(i)
> 
> In clojure this
> 
> (for [ x (set (range 4))] (* 4 x))
> 
> generates a list.
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to