Changeset 25900 in project
- Timestamp:
- 02/14/12 07:14:22 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wiki/eggref/4/vlist
r25899 r25900 30 30 since vlist elements are adjacent, which plays well with caches. 31 31 32 === Procedures32 === List procedures 33 33 34 34 … … 119 119 120 120 Calls {{proc}} on each element of {{vlist}}. 121 122 === Hash list procedures 123 124 Hash vlists are analogous to association lists. 125 126 127 <procedure>vhash? obj -> boolean</procedure> 128 129 Returns true if {{obj}} is a hash vlist, false otherwise. 130 131 <procedure>vhash-cons key value vhash [hash] -> vhash</procedure> 132 <procedure>vhash-consq key value vhash [hash] -> vhash</procedure> 133 <procedure>vhash-consv key value vhash [hash] -> vhash</procedure> 134 135 Return a new hash list based on {{vhash}} where {{key}} is associated with 136 {{value}}. Use {{hash}} to compute {{key}}'s hash. 137 138 <procedure>vhash-fold* proc init key vhash -> value</procedure> 139 140 Folds over all the values associated with {{key}} in {{vhash}}, with 141 each call to {{proc}} having the form {{(proc value result)}}, where 142 {{result}} is the result of the previous call to {{proc}} and {{init}} 143 the value of {{result}} for the first call to {{proc}}. 144 145 <procedure>vhash-foldq* proc init key vhash -> value</procedure> 146 147 Same as {{vhash-fold*}}, but using {{eq?-hash}} and {{eq?}}. 148 149 <procedure>vhash-foldv* proc init key vhash -> value</procedure> 150 151 Same as {{vhash-fold*}}, but using {{eqv?-hash}} and {{eqv?}}. 152 153 <procedure>vhash-assoc key vhash [equal?] [hash] -> (key . value)</procedure> 154 155 Returns the first key/value pair from {{vhash}} whose key is equal to 156 {{key}} according to the {{equal?}} equality predicate. 157 158 <procedure>vhash-assq key vhash -> (key . value)</procedure> 159 160 Returns the first key/value pair from {{vhash}} whose key is {{eq?}} 161 to {{key}}. 162 163 <procedure>vhash-assv key vhash -> (key . value)</procedure> 164 165 Returns the first key/value pair from {{vhash}} whose key is {{eqv?}} 166 to {{key}}. 167 168 <procedure>vhash-delete key vhash [equal?] [hash] -> vhash</procedure> 169 <procedure>vhash-delq key vhash [equal?] [hash] -> vhash</procedure> 170 <procedure>vhash-delv key vhash [equal?] [hash] -> vhash</procedure> 171 172 Removes all associations from {{vhash}} with {{key}}, comparing keys 173 with {{equal?}}. 174 175 176 <procedure>vhash-fold proc init vhash</procedure> 177 178 Folds over the key/pair elements of {{vhash}} from left to right, with 179 each call to {{proc}} having the form {{({{proc}} key value result)}}, 180 where {{result}} is the result of the previous call to {{proc}} and 181 {{init}} the value of {{result}} for the first call to {{proc}}. 182 183 184 <procedure>vhash-fold-right proc init vhash</procedure> 185 186 Folds over the key/pair elements of {{vhash}} from right to left, with 187 each call to {{proc}} having the form {{({{proc}} key value result)}}, 188 where {{result}} is the result of the previous call to {{proc}} and 189 {{init}} the value of {{result}} for the first call to {{proc}}. 190 191 192 <procedure>alist->vhash alist [hash] -> vhash</procedure> 193 194 Returns the vhash corresponding to {{alist}}, an association list. 195 121 196 122 197
Note: See TracChangeset
for help on using the changeset viewer.