Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I haven’t used clojure in quite a while but what’s the issue with (let [a b] …)?

Is (let (a b) …) even valid clojure?



In CL and Scheme, it's (let ((var1 val) (var2 val)) body...). So parentheses are used for grouping and function/macro application. In Clojure, parens are just used for application, so you have e.g. (let [var1 val var2 val] body...), or (defn foo [x] ..) or (cond testa 1 testb 2 ...).

It takes some getting used to, and I do wish Clojure would do something more like (let [[var1 val] [var2 val]] ... .. though of course then you'd have to figure something else out for destructuring.


I believe it would be (let ‘(a b)), but I’m not sure if that’s valid or not. That’s how Racket does its version of defn




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: