This commit is contained in:
NaiJi ✨ 2021-03-11 14:57:35 +01:00
parent b7e479c7a6
commit f728095792
1 changed files with 11 additions and 0 deletions

11
sicp-ex-1.30.rkt Executable file
View File

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