On Tue, May 28, 2013 at 2:06 AM, Jim Ursetto <zbignie...@gmail.com> wrote:
>
> On May 27, 2013, at 4:14 PM, Michele La Monaca <mikele.chic...@lamonaca.net> 
> wrote:
>
>> So writing down the options, we have:
>>
>> (let* loop ((i (random N)) (ch (string-ref buf i)))
>>  (do-something)
>>  (if (some-condition-is-true)
>>    (loop (+ i 1)
>>          (string-ref buf (+ i 1)))))
>>
>> vs.
>>
>> (let ((start (random N)))
>>  (let loop ((i start) (ch (string-ref buf start)))
>>    (do-something)
>>    (if (some-condition-is-true)
>>      (loop (+ i 1)
>>            (string-ref buf (+ i 1))))))
>>
>> vs.
>>
>> (let ((ch '()))
>>  (let loop ((i (random N)))
>>    (set! ch (string-ref buf i))
>>    (do-something)
>>    (if (some-condition-is-true)
>>      (loop (+ i 1)))))
>
>
> Why not
>
> (let loop ((i (random N)))
>   (let ((ch (string-ref buf i)))
>    (do-something)
>    (if (some-condition-is-true)
>      (loop (+ i 1)))))
>

Yes, sure. Thanks for spotting the omission.

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to