1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
;;;; Indexes into dictionary vectors
;;; Add more at the end for new dictionary methods
;;; Add an entry to model-vec as well
(define d? 0)
(define dempty? 1)
(define dcontains? 2)
(define dref 3)
(define dref/default 4)
(define dset! 5)
(define dadjoin! 6)
(define ddelete! 7)
(define ddelete-all! 8)
(define dreplace! 9)
(define dintern! 10)
(define dupdate! 11)
(define dupdate/default! 12)
(define dpop! 13)
(define dmap! 14)
(define dfilter! 15)
(define dremove! 16)
(define dsearch! 17)
(define dsize 18)
(define dfor-each 19)
(define dcount 20)
(define dany 21)
(define devery 22)
(define dkeys 23)
(define dvalues 24)
(define dentries 25)
(define dfold 26)
(define dmap->list 27)
(define d->alist 28)
;;; Sample of a call to an internal procedure from another internal procedure:
;;; (dcall dref/default vec dict key default)
;;; Maps names to indexes
(define dname-map
`((dictionary? . ,d?)
(dict-empty? . ,dempty?)
(dict-contains? . ,dcontains?)
(dict-ref . ,dref)
(dict-ref/default . ,dref/default)
(dict-set! . ,dset!)
(dict-adjoin! . ,dadjoin!)
(dict-delete! . ,ddelete!)
(dict-delete-all! . ,ddelete-all!)
(dict-replace! . ,dreplace!)
(dict-intern! . ,dintern!)
(dict-update! . ,dupdate!)
(dict-update/default! . ,dupdate/default!)
(dict-pop! . ,dpop!)
(dict-map! . ,dmap!)
(dict-filter! . ,dfilter!)
(dict-remove! . ,dremove!)
(dict-search! . ,dsearch!)
(dict-size . ,dsize)
(dict-for-each . ,dfor-each)
(dict-count . ,dcount)
(dict-any . ,dany)
(dict-every . ,devery)
(dict-keys . ,dkeys)
(dict-values . ,dvalues)
(dict-entries . ,dentries)
(dict-fold . ,dfold)
(dict-map->list . ,dmap->list)
(dict->alist . ,d->alist)))
|