On Sun, Feb 9, 2020 at 9:33 AM Thomas Morley <thomasmorle...@gmail.com>
wrote:

> Am So., 9. Feb. 2020 um 15:02 Uhr schrieb Freeman Gilmore
> <freeman.gilm...@gmail.com>:
> >
> >
> >
> > 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) ...)
>
I understand the above and below but not this  let ((rand (random 100)))
Put in your form:   (let ((rand (random 100))) ...)

Here is another example from the book, why double parenthesis ((assq
'col-darkblue colors)).

Thank for all you work here, ƒg

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
>

Reply via email to