Function that multiplies all numbers between "a" and "b" with do loop I'm making a function that multiplies all numbers between an "a" input and a "b" input with do loop. If you please, check my function and say what's wrong since I don't know loops very well in Scheme.

(define (pi-function x y)
  (let ((result y))
    (do ((limI x (+ x 1)))
        ((= limI y) result)
      (set! result (* result limI)))))
You can use a do loop without using set!.

(define (product-of-range x y)
  (do ((result 1 (* result i))
       (i x (+ i 1)))
      ((&gt; i y) result)))