Hacker News Realest Joined Sep 15, 2022 Messages 72,648 Reaction score 15 BC ฿0 Dividends 0 Oct 31, 2022 #1 Mine was when I learned a subset of recursion called mutual recursion. It was for a pair of function to determine if a number was odd or even. (define (odd? x) Code: (cond [(zero? x) #f] [else (even? (sub1 x))])) (define (even? x) Code: (cond [(zero? x) #t] [else (odd? (sub1 x))])) Comments URL: https://news.ycombinator.com/item?id=33413124 Points: 10 # Comments: 0 Continue reading...
Mine was when I learned a subset of recursion called mutual recursion. It was for a pair of function to determine if a number was odd or even. (define (odd? x) Code: (cond [(zero? x) #f] [else (even? (sub1 x))])) (define (even? x) Code: (cond [(zero? x) #t] [else (odd? (sub1 x))])) Comments URL: https://news.ycombinator.com/item?id=33413124 Points: 10 # Comments: 0 Continue reading...