private/hash-cons.ss
(module hash-cons mzscheme
  
  (require "../make-hash-struct.ss"
           (lib "etc.ss"))
  (provide hash-cons)
  
  ;; hash-cons: X Y -> (cons X Y)
  ;; Like cons, but remembers arguments.  If it can, it will try for
  ;; maximal sharing.
  ;;
  ;; WARNING: don't use the resulting cons pair with mutation!
  (define hash-cons
    (make-hash-struct cons 2 (#f #f) (set-car! set-cdr!))))