Arrays being truthy in JS still catches me out sometimes.
In Python or Lisp, empty lists are falsey and truthiness is safe and idiomatic.
miniblog.
Related Posts
I've just added `and` to my toy lisp compiler: https://github.com/Wilfred/proper-compiler-hat/commit/af5c77e30ecbf4884e71c1177a086337aa74d237
It's just a plain function, not a macro or special form. Is that so bad? I've seen confusing uses of `and` with truthiness e.g. `(and maybe-nil (compute-default))` and I'd rather avoid that.
Impressive! Elm can detect if you're assuming truthiness semantics,& the type checker will make helpful suggestions:
I like the concept of truthiness, but it's hard switching between languages. Python, JS and elisp all have different opinions on.