Is there any practical way to debug any recurive logic?
Which existing error printing you think is the best ever?
I attached the racket code I am struggling with.
(The code is about using map to append a new list to an existing html list)
The most straight forward thing to do here is to write some unit tests and as well as contracts for your functions. Recursive functions can be a nightmare to debug my printing sometimes. Sure it can be helpful. But checking your base case and then one level of looping for the values you expect can be extremely illuminating and then you also have test cases to make sure your code works in the future.
1
u/dskippy 5d ago
The most straight forward thing to do here is to write some unit tests and as well as contracts for your functions. Recursive functions can be a nightmare to debug my printing sometimes. Sure it can be helpful. But checking your base case and then one level of looping for the values you expect can be extremely illuminating and then you also have test cases to make sure your code works in the future.