I find that let
has too many brackets. For example, when writing the following block of code, it was very easy to misplace let
s many closing brakcets.
(define (adder n)
(let ((a 1))
(+ a n)))
All of these brackets are clearly necessary for huge let
blocks, but they feel redundant for smaller calls. Does Scheme have any syntactic sugar for trivial calls to let? For example, what about cases where I only want to locally bind one variable? I had considered define
, but apparent it's dangerously dependent on your choice of implementation. Is there any built-in solution to this that doesn't share that flaw? I'd prefer to not have to write a macro. Essentially, I'm looking for the procedure that is to let
what if
is to cond
.