该题实现如下:
(define (tree-map pro tree)
(map (lambda (x-tree)
(if (pair? x-tree)
(tree-map pro x-tree)
(pro x-tree)))
tree))
递归调用原则:假设要实现的函数为F,只要满足如下条件就可以在函数体中递归调用F:
1、调用时想要F实现的功能与定义时一致
2、参数类型完全相同
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Congratulations @yangbb! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Do not miss the last post from @steemitboard:
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit