Re: Help request: clojurescript macro for object property access

2011-12-19 Thread Dave Sann
To clarify, the key in the map/object would be munged. -- 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 po

Re: Help request: clojurescript macro for object property access

2011-12-19 Thread Dave Sann
The corollary of this would be that, in advanced mode, there is no way to pass a property key to a function to access a js object property because the key would be munged. Right? In which case - you need to be careful when attempting this sort of access. For the case above, for now, I ported t

Re: Help request: clojurescript macro for object property access

2011-12-19 Thread Dave Sann
Nevermind, I think I can see why this is a non-starter -- 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 firs

Re: Help request: clojurescript macro for object property access

2011-12-19 Thread Dave Sann
I will give a concrete example as explanation. In pinot.events there is a function "on" (on elems :click event_handler) :click goes on to be looked up in the javascript map EventType in goog.events This lookup is done by string - which is fine in unoptimised code but does not work in advanc

Re: Help request: clojurescript macro for object property access

2011-12-19 Thread David Nolen
On Mon, Dec 19, 2011 at 8:58 PM, Dave Sann wrote: > I would like to have a macro to do the following, is this possible? > > (getm javascript-map "key") > > expands to: > > (.key javascript-map) > What advantage does the former have over the latter? The latter is shorter. Also the new property sy

Help request: clojurescript macro for object property access

2011-12-19 Thread Dave Sann
I would like to have a macro to do the following, is this possible? (getm javascript-map "key") expands to: (.key javascript-map) This is to manage situations where a javascript map/object is accessed by string key. In advanced optimisations mode this will fail. The key must be accessed as a p