Trying out exercises from "Structure and Interpretation of Computer Programs" second edition
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
226 B

#! /usr/bin/racket
#lang racket/base
(define (sum term a next b)
(define (iter a result)
(if (> a b)
(iter (next a) (+ (term a) result))))
(iter a 0))
(sum (lambda (x) x) 0 (lambda (x) (+ x 1)) 3)