Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
gsinclair
on Feb 2, 2023
|
parent
|
context
|
favorite
| on:
History of Lisp Parentheses (2019)
The convention is enforced in Clojure. [] for bindings, {} for maps.
funcDropShadow
on Feb 2, 2023
|
next
[–]
It is not a convention in Clojure. (), [], {}, #{} represent different data structures.
Sakos
on Feb 2, 2023
|
parent
|
next
[–]
It's really just syntactic sugar, so I would agree with the statement that the convention is being enforced.
funcDropShadow
on Feb 3, 2023
|
root
|
parent
|
next
[–]
You get different data structures. I.e. printing #{ 1 1 2 2 } prints #{ 1 2 } whereas [ 1 1 2 2 ] prints [ 1 1 2 2].
tmtvl
on Feb 2, 2023
|
prev
[–]
Not exactly, it uses square brackets for vectors sometimes and curly brackets for maps sometimes, yet other times it uses square brackets for maps:
(let [a 1 b 2] (+ a b))
Instead of:
(let {a 1 b 2} (+ a b))
(I think my map notation may be wrong, I always just bounce off Clojure so I'm bound to make mistakes).
Consider applying for YC's W25 batch! Applications are open till Nov 12.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: