5 ms·
I don't understand this clojurism of not making let-expression bindings adhere to the "parenthesise everything" of regular lisps. Why make let special? Why have
by Johnny_Brahms 10y ago
I don't understand this clojurism of not making let-expression bindings adhere to the "parenthesise everything" of regular lisps. Why make let special? Why have a parser exception for some things?
It is just a cosmetic thing,but it bormthers my otherwise so paren-friendly eyes.
- meric 10y agoIf it helps I'm thinking of expanding the usage of those bindings to function keyword and default arguments as well. :)
- abecedarius 10y agoI dislike it, too, but if tweaks like that help a new generation get into Lisp, then shrug. And the parens in the original LET form really are a bit much. In my own Lisp you go like (let a 42) (let b (+ a 1)) (blorgle a b)
- dTal 10y agoThat looks more like (define) than (let). When do the bindings fall back out of scope, if not when the let-form ends? And can you do multiple bindings?
- abecedarius 10y agoYes, it's pretty much like Scheme define but with pattern matching (and correspondingly without the (define (do-it) ...) shorthand; you say (to (do-it) ...) instead). They go out of scope at the end of a scope block, as usual; but conditionals introduce subscopes for the different branches. There's a (hide ...) macro I use occasionally. To bind multiple things at once, there's the pattern matching, e.g. (let `(,x ,y) point) (Not sure if that's what you're asking about.) It's always bugged me in Scheme how binding forms are repeated, one type like DEFINE and another like LET, and DEFINE behaving not quite the same at top level vs. internally. (Added: Another little nit that to me grew over the years is that Scheme is just kind of verbose. You don't want to see shorter, clearer code in Python.)