Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Racket

Name: Anonymous 2012-09-25 13:28

there must be a better way to do this right


(define (factorial n)
    (define (iter n result)
        (if (= n 0)
            result
            (iter (- n 1) (* result n))))
    (iter n 1))

Name: Anonymous 2012-09-25 18:30

>>19
I don't think you understand what's going on here. That's what your compiler does. That's what my compiler does. It is not what every compiler in the set of all conforming C compilers do.

>>24-25
Ty.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List