SICP练习2.31总结:递归调用原则

in cn •  6 years ago 

该题实现如下:
(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!
Sort Order:  

Congratulations @yangbb! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

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:

Valentine's day challenge - Give a badge to your beloved!
Vote for @Steemitboard as a witness to get one more award and increased upvotes!