You want to use let
.
(let ( (name value)
(othername othervalue))
expression-using-name)
So
(define (map-it n)
(let ((filt (lambda (l)
(filter number? l)))
(mpan (lambda (b)
(map add1 b))))
(mapit map list n)))
But what are you trying to accomplish here? You're not actually using mapn
or filt
anywhere.
I think you can just use
(define (mapl n)
(define (filt n)
(filter number? n))
(define (mapn n)
(map add1 (filt n)))
(map list (mapn n)))
Since scheme allows nested definitions.