On Feb 29, 2:36 pm, Benjamin Peter <benjaminpe...@arcor.de> wrote:
> Hello,
>
> when I was trying to port a little clojure app to clojurescript I
> think I noticed a difference in behavior of the "for" macro.
>
> I am quite new to clojure and maybe you can tell me where my problem
> is or if my assumptions that there might be a problem could be
> correct.
>
> As far as I see it, the "for" macro works for clojurescript quite well
> but I am not sure if it is "supported".
>
> I am using a two dimensional "for" with a ":when" condition. I already
> tried to narrow the problem down but this was the closest I could get
> so far. It seems like some elements are missing in the output.
>
> (for [a [0 1] b [0 1]
>          :when (not (= 0 a b))]
>          [a b])
>
> In clojurescript seems to result in:
>
> [[1 0] [1 1]]
>
> Wrapping to doall doesn't change a thing, but could lazyness be a
> problem?
>
> I put together a little project you could check out, please have a
> look:
>
> https://github.com/dedeibel/cljs-fortest

Isn't this a special case of cljs not having the right equality
semantics for multiple args? I don't have a clojurescript repl handy,
but I remember reading it only looks at the first two args, so (= 0 0
1) returns true, keeping that one out of your results.

-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to