I have been programming for about ~2 years, and mostly wrote OOP and structural code. Recently, I have decided to pick up a functional programming language, and Haskell being too alien for me, looked to Racket (since it is high time I learned a LISP anyways) and am loving it. Since this is a new area of programming for me, I would appreciate any feedback you could give me on this program. It is the solution to the first Project Euler program.
;If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. ;Find the sum of all the multiples of 3 or 5 below 1000. #lang racket (define max 1000) (define (multiple_of base test) (equal? (remainder test base) 0)) (define (primes current total) (if (< current max) (primes (+ current 1) (+ total (if (or (multiple_of 5 current) (multiple_of 3 current)) current 0))) total)) (primes 1 0) ; Output: 233168 ; Success