The (str "hello " req/params/name) definitely never worked, at least I cannot 
see how. Due to recent work on the CLJS compiler it might not have been 
reported as an error before though. Compilation should warn at least, at 
runtime you'll just get a null since the var doesn't exist.

I believe older versions of ClojureScript (before tools.reader) might have 
"allowed" req/params/name as a valid symbol, the current version fails as 
expected.

Just guessing though.

On Monday, March 10, 2014 11:49:07 AM UTC+1, Mark Fisher wrote:
> Hi Thomas,
> 
> Thankyou very much for the explanations and examples. All worked fine in both 
> simple and advanced compilation. I was about to try aget, but the examples I 
> found were using integer indexes so assumed (wrongly) I couldn't use it here 
> with strings.
> 
> I'll have a look at the inspect things you mention, but you've moved me along 
> nicely for now.
> 
> Would you know if the original syntax used in both examples I linked changed 
> in clojurescript or would it have been a restify change? I can't see how they 
> ever compiled previously, as I don't recognise it from my readings.
> 
> Cheers,
> Mark
> 
> On Monday, 10 March 2014 09:22:06 UTC, Thomas Heller  wrote:
> > Hey,
> > 
> > there are many ways to get the properties of a javascript object, but if 
> > you want to rely on advanced compilation and might miss some externs its 
> > probably best to use aget.
> > 
> > (let [name (aget req "params" "name")] ...)
> > 
> > But these work too
> > 
> > (.. req -params -name)
> > (-> req .-params .-name)
> > 
> > If you want to print an object you could do (pr-str (js->clj obj)), or use 
> > some of the inspect things node has (I think).
> >

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to