RosettaCodeData/Task/Associative-array-Merging/Racket/associative-array-merging.rkt

17 lines
401 B
Racket

#lang racket/base
(require racket/hash)
(module+ test
(require rackunit)
(define base-data (hash "name" "Rocket Skates"
"price" 12.75
"color" "yellow"))
(define update-data (hash "price" 15.25
"color" "red"
"year" 1974))
(hash-union base-data update-data #:combine (λ (a b) b)))