Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

26 рядки
666 B

  1. (define hm1 (hash-map))
  2. (hm/set! hm1 1 "a")
  3. (hm/set! hm1 "a" (lambda (x) (+ x 1)))
  4. (assert (= ((hm/get hm1 (hm/get hm1 1)) 2) 3))
  5. (define hm2 (hash-map))
  6. (hm/set! hm2 'yes :yes)
  7. (hm/set! hm2 :yes 'yes)
  8. (assert (= (hm/get hm2 'yes) :yes))
  9. (assert (= (hm/get hm2 :yes) 'yes))
  10. (assert (= (hm/get hm2 (hm/get hm2 'yes)) 'yes))
  11. (assert (= (hm/get hm2 (hm/get hm2 :yes)) :yes))
  12. (assert (= (hm/get hm2 (hm/get hm2 (hm/get hm2 'yes))) :yes))
  13. (assert (= (hm/get hm2 (hm/get hm2 (hm/get hm2 :yes))) 'yes))
  14. (define hm3 (hash-map))
  15. (hm/set! hm3 + 'plus)
  16. (hm/set! hm3 - 'minus)
  17. (assert (= (hm/get hm3 +) 'plus))
  18. (assert (= (hm/get hm3 -) 'minus))