我是Lisp的新手,需要帮助理解这个功能和(map length '((a b c) (1 2 3 4 5) (v1 v2 v3 v4 v5 v6))))
值为(3 5 6)
(define (map f list)
; applies function f to each element of list
(if (null? list)
()
(cons (f (car list))
(map f (cdr list)))))
(define map-test-1
(map square '(1 2 3 4 5)))
(define map-test-2
(map length '((a b c) (1 2 3 4 5) (v1 v2 v3 v4 v5 v6))))