Am So., 9. Feb. 2020 um 15:02 Uhr schrieb Freeman Gilmore
<[email protected]>:
>
>
>
> This is taken from the "Scheme Book".
>
> Question why double parenthesis for let ((rand (random 100))) ?
>
> Thank you, ƒg
Well, every expression needs to be wrapped into parenthesis.
One pair for the let-expression:
(let ...)
One pair for all local-bindings:
(let (all-local-bindings) ...)
One pair for each single local binding, note every local binding is of
type key-value:
(let ( (key1 value1) (key2 value2) ) ...)
Every value my be a procedure call, with the need for another pair of
parenthesis:
(let ( (key1 (proc1 args1)) (key2 (proc2 args2)) ) ...)
Proper indentation increases readability:
(let (
(key1 (proc1 args1))
(key2 (proc2 args2))
)
...
)
HTH,
Harm