4 ms·
Aren't there 11 parentheses in both of your code snippets? I must be missing something, sorry could you possibly explain where the missing parenthesis should be
by bloopernova 3y ago
Aren't there 11 parentheses in both of your code snippets? I must be missing something, sorry could you possibly explain where the missing parenthesis should be?
- taeric 3y agoIt helps to basically vocalize what the code is doing. It is a "let" form, which has a list of variables, and then a body section using them. (It is a "let*", which also means that the variables can refer to variables that come before them, but not too relevant here.) To that end, the first () in a "let" should be of the forms (name value), where value can be a longer form, if needed. To that end, the last (name value) in the list should almost always look like (name value)), as it is closing the first in the list, that is ((name value).
- lelandbatey 3y agoThey're not saying that the second snippet is "fixed", they're saying that the auto-indented second snippet highlights the mistake to the reader. Yes there are 11 parentheses in both the code snippets because both are "incorrect" in that they're both missing a parenthesis. The GP is trying to point out that since Emacs automatically re-indents the first snippet so that it looks like the second snippet, the reader knows immediately that something "isn't quite right".
- bloopernova 3y agoAhhh, understood. Thank you!
- phoe-krk 3y ago(let* ((foo 10) (bar (+ foo 32))) (* foo bar)) Or, to demonstrate the ugly "nailclip" style: (let* ((foo 10) (bar (+ foo 32))) (* foo bar) ) Note that I moved a closing paren off the third line and onto the second one, to close the variable bindings in the LET* form.
- bloopernova 3y agoThat explains it, thank you!