PasteRack.org
Paste # 89285
2019-05-23 08:09:36

Fork as a new paste.

Paste viewed 611 times.


Embed:

Using mutable keys in equal?-based hash tables

  1. #lang racket
  2. (define o (box 1))
  3. (define h (hash-set (hash) o 123))
  4. (set-box! o 2)
  5. (hash-ref h o)
  6. ; hash-ref: no value found for key
  7. ;   key: '#&2
  8. ; [,bt for context]

=>

hash-ref: no value found for key

  key: '#&2