Re: [racket] Behaviour of gen:custom-write method

2014-05-17 Thread Jens Axel Søgaard
Hi Hamish, I find this confusing too. It seems that the pretty printer calls the different handlers in order to detect cycles. If one turns of the pretty printer I get two calls instead of one. I am not exactly sure, why the pretty printer needs to this. The code in question: https://github.com

[racket] Behaviour of gen:custom-write method

2014-05-17 Thread Hamish Ivey-Law
Dear Racket-users I am trying to understand the behaviour of the `gen:custom-write` method. What I find confusing is that the `write-proc` function is called twice for explicit calls to `write`, `display` or `print` and three times when display happens in the (x)repl. For example: -> (struct thi