> Now compare to the proposed change: > (set! (. foo :id) "my-css-id")) > (set! (. ctxt :fillStyle) "rgb(255, 150, 0)")
In the original discussion in this list, a couple alternatives similar to the following were suggested for property access to remain closer to the Clojure situation: (set! (.:id foo) "my-css-id")) (set! (.:fillStyle ctxt) "rgb(255, 150, 0)") Were those thrown out for being too ugly? - Mark On Fri, Oct 14, 2011 at 9:19 PM, David Nolen <dnolen.li...@gmail.com> wrote: > Sorry I didn't copy my perspective over here from clojure-dev as someone > who's been working as a JavaScript dev for the past 6 years > ----- > > > The proposed change is not optimal and I think it clashes with the realities > of JavaScript interop. > (.property foo) > Currently gives us a notion of "place", that means we can set it: > (set! (.property foo) "bar") > This convention is quite common in many JavaScript APIs, for example pretty > everything in the browser: > (set! (.id foo) "my-css-id")) > (set! (.fillStyle ctxt) "rgb(255, 150, 0)") > Now compare to the proposed change: > (set! (. foo :id) "my-css-id")) > (set! (. ctxt :fillStyle) "rgb(255, 150, 0)") > I don't see any win. Any proposed change should account for the fact that > getters / setters are not a convention in JS and many, many APIs expect > direct field access. > David > On Fri, Oct 14, 2011 at 9:15 PM, Jack Moffitt <j...@metajack.im> wrote: >> >> > Thoughts? >> >> I like it. +1 to it going in sooner rather than later. >> >> jack. >> >> -- >> 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 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 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