There are essentially 5 ways to "initialize" a list
(let (results)
(--each ... (push x results)))
(let ((results))
(--each ... (push x results)))
(let ((results nil))
(--each ... (push x results)))
(let ((results ()))
(--each ... (push x results)))
(let ((results '()))
(--each ... (push x results)))
Personally I use 2 and 3 and prefer 2 if there are multiple bindings at the same time
(let ((x 1)
(y 2)
(results)
(z 3))
(--each ... (push x results)))
Having it wrapped in the parens sort of signifies to me it's a list. A nil there wouldn't hurt though, I'm just lazy.
I was hoping there would be some way to distinguish () and nil for example for the purpose of analysis but they both appear as nil to the reader, so meh.
There are essentially 5 ways to "initialize" a list
Personally I use 2 and 3 and prefer 2 if there are multiple bindings at the same time
Having it wrapped in the parens sort of signifies to me it's a list. A nil there wouldn't hurt though, I'm just lazy.
I was hoping there would be some way to distinguish
()andnilfor example for the purpose of analysis but they both appear asnilto the reader, so meh.