Maybe I misunderstand, but doesn't https://docs.racket-lang.org/reference/mpairs.html already solve this?
Unless it is a purely educational exercise of how to implement such a thing of course. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.