You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
-
- (define hm1 (hash-map))
-
- (hm/set! hm1 1 "a")
- (hm/set! hm1 "a" (lambda (x) (+ x 1)))
-
- (assert (= ((hm/get hm1 (hm/get hm1 1)) 2) 3))
-
- (define hm2 (hash-map))
- (hm/set! hm2 'yes :yes)
- (hm/set! hm2 :yes 'yes)
-
- (assert (= (hm/get hm2 'yes) :yes))
- (assert (= (hm/get hm2 :yes) 'yes))
- (assert (= (hm/get hm2 (hm/get hm2 'yes)) 'yes))
- (assert (= (hm/get hm2 (hm/get hm2 :yes)) :yes))
- (assert (= (hm/get hm2 (hm/get hm2 (hm/get hm2 'yes))) :yes))
- (assert (= (hm/get hm2 (hm/get hm2 (hm/get hm2 :yes))) 'yes))
-
- (define hm3 (hash-map))
- (hm/set! hm3 + 'plus)
- (hm/set! hm3 - 'minus)
-
- (assert (= (hm/get hm3 +) 'plus))
- (assert (= (hm/get hm3 -) 'minus))
|