1234567891011121314151617 |
- #lang racket
- (provide box box-value set-box-value!
- assoc-box-set!)
- ;;; box based mutable assoc
- ;;
- (struct box ((value #:mutable)) #:transparent)
- (define (assoc-box-set! soc key value)
- (cond ((assoc soc key) =>
- (lambda (entry)
- (set-box-value! (cdr entry) value)))))
|