On May 27, 2013, at 4:14 PM, Michele La Monaca <[email protected]> 
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)))))


_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to