|
|
|
|
|
by keymone
3253 days ago
|
|
it's one of the controversial points in lisp dialects. treating empty list as nil means it's falsey when used as predicate which has it's pros and cons. for instance if empty list is truthy, this pseudocode won't terminate if tail is defined to always be a (possibly empty) list: while seq:
head, seq = seq.head_tail()
f(head)
|
|
Parens aren't used for any collection type in Elixir ( `(1,2,3)` is just a syntax error), so the lispyness explanation for () being nil in Elixir, while neat, doesn't really make sense