Allright, so I'll probably stick to top-level lets... Thx! Op woensdag 26 augustus 2015 18:44:18 UTC+2 schreef Herwig Hochleitner: > > I can't really speak to what's more idiomatic, but there is a slight > difference between a top-level let and ^:const ^:private. > ^:const makes the compiler directly inline the form, thus it works only on > pr-dup - able values. This has gotten me by surprise some times. > This also duplicates values, that would otherwise be referenced. > > OTOH, a let compiles into a static field + regular access, also it's "more > private" in the sense that you can't even get it by the (rather obscure) > @#'private-var form > > Personally, I think there is nothing wrong with top-level lets and I like > to use them, just to keep compiler writers honest. There had been a > clojurescript bug related to this once. > Also they are more explicit about scope than the reference tree implicit > in namespace vars. >
-- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.