Closed porky11 closed 7 years ago
I don't think this is a good change, because it's an extra case that the developer has to remember when reading, but only gives a very slight advantage to the author when writing. It also means that a macro author who is working against let
has to remember to handle this exceptional case, in addition to the standard syntax.
Its done the same way for for
:S That's a good point. I've thought a bit harder about this, and would still prefer not to make the change, for the following additional reasons:
let
in both CL and Scheme does not work like this: Scheme doesn't support the syntax, whereas in CL, (let (a b c))
binds three undefined variables named a
, b
, and c
. Obviously there are myriad differences between both of those languages and this one, but avoiding potential confusion for newcomers, especially when the alternative is providing only a small benefit, seems reasonable.for
supports the single-variable definition syntax, it's worthwhile making an exception there, because the vast majority of for loops involve binding a single variable. There is no for
in CL or Scheme, so most people will be working from their understanding from C or a C-like language, and the for
here is very similar to those.let
might imply a general principle that lists of lists can avoid double parentheses when only one element is present and the result is unambiguous. Either the remaining changes would be made, e.g. to function parameter lists, making the language more complicated, or new users would potentially become confused at this logic being applied in some areas (let
, for
) but not others. (Of course, for
is already exceptional, but there are compelling reasons there for the exception.)good points, thx
because
(let (a b c))
without types isn't possible anyway, this could mean the same as(let ((a b c)))