Y
Hacker News
new
|
ask
|
show
|
jobs
by
akkartik
5719 days ago
Why do you miss dictionary literals? Syntax similar to arc's seems to do it for me:
(obj a 1 b 2 c 3)
2 comments
gruseom
5719 days ago
We do the same thing:
(make :a 1 :b 2 :c 3)
which macroexpands into a plist in CL and {a:1, b:2, c:3} in JS. I've grown to like this idiom a lot. Yeah, you have to type OBJ or MAKE or whatever but in return you get something that integrates completely smoothly with the rest of the language.
link
metageek
5719 days ago
Y'know, I'm not sure. Next time I need to use a hash, I'll create something like that and see how it feels.
link