Browse Source

Add 1.30

master
NaiJi 8 months ago
parent
commit
f728095792
  1. 11
      sicp-ex-1.30.rkt

11
sicp-ex-1.30.rkt

@ -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)
Loading…
Cancel
Save