wisp-lang / wisp

A little Clojure-like LISP in JavaScript
https://gozala.github.io/wisp/
Other
982 stars 68 forks source link

Dictionary/hash-map key names #129

Closed robjens closed 9 years ago

robjens commented 9 years ago

I'll just keep calling them hash-map for obvious reasons, even though the author of this lib made a apparently conscious and deliberate choice to name them otherwise, but this is beside the point, one thing I found a bit 'counter-intuitive' is that map literal names are not translated to their JS equivalents e.g.

(print {:foo? :bar})
;=> {'foo?': 'bar'}

As opposed to

(print {:foo? :bar})
;=> {'isFoo': 'bar'}

I would assume this is by design deliberate choice as well, I am just wondering why? Because, at least in my use-case, often we use literal objects in several steps of our process from intermediate data carrying over (passing the buck) to final data representation and contains - they're everywhere.

Now I could understand perhaps if this was tried and found too constraining for the compiler, performance lacked (due to their abundance) or for some other reason, I'm just a bit curious as to the reasoning behind it.

edit: my use-case involves mongodb object literals and I really dislike having to make maps that are like, {:someBar :meh} in 'lispy' code as much as possible :P (although I would bear/manage)

robjens commented 9 years ago

Can close this, see now how this would potentially be problematic in certain areas.