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

in #cn5 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、参数类型完全相同

Sort:  

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!

Coin Marketplace

STEEM 0.28
TRX 0.13
JST 0.032
BTC 60896.14
ETH 2915.81
USDT 1.00
SBD 3.55