Changes between Version 73 and Version 74 of HashTablesCowan


Ignore:
Timestamp:
11/03/13 01:07:55 (4 years ago)
Author:
cowan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HashTablesCowan

    v73 v74  
    267267Semantically equivalent to, but may be implemented more efficiently than, the following code: 
    268268 
    269   `(hash-table-update!/default `''hash-table key''` (lambda (x) (cons `''value''` x)) '())` 
     269  `(hash-table-update!/default `''hash-table key''` (lambda (x) (cons `''value''` x)) (list `''value''`))` 
    270270 
    271271`(hash-table-pop! `''hash-table key''`)` 
     
    346346Returns a newly allocated hash table using ''comparator''.  Calls ''proc'' for every association in ''hash-table'' with two arguments, the key and the value of the association, and enters all associations  for which ''proc'' returns true into the new hash table. 
    347347 
     348`(hash-table-remove `''comparator proc hash-table''`)` 
     349 
     350Returns a newly allocated hash table using ''comparator''.  Calls ''proc'' for every association in ''hash-table'' with two arguments, the key and the value of the association, and enters all associations  for which ''proc'' returns false into the new hash table. 
     351 
     352`(hash-table-filter! `''comparator proc hash-table''`)` 
     353 
     354Calls ''proc'' for every association in ''hash-table'' with two arguments, the key and the value of the association, and removes all associations  for which ''proc'' returns false from ''hash-table'', which is returned. 
     355 
    348356`(hash-table-partition `''comparator proc hash-table''`)` 
    349357 
    350358Returns two values, both newly allocated hash tables using ''comparator''.  Calls ''proc'' for every association in ''hash-table'' with two arguments, the key and the value of the association, and enters all associations for which ''proc'' returns true into the first hash table and all other associations into the second hash table. 
    351359 
     360`(hash-table-any? `''comparator proc hash-table''`)` 
     361 
     362Calls ''proc'' for as many associations in ''hash-table'' as necessary with two arguments, the key and the value of the association.  If any invocation of ''proc'' returns true, `hash-table-any?` returns `#t`; otherwise it returns `#f`. 
     363 
     364`(hash-table-every? `''comparator proc hash-table''`)` 
     365 
     366Calls ''proc'' for as many associations in ''hash-table'' as necessary with two arguments, the key and the value of the association.  If every invocation of ''proc'' returns true, `hash-table-any?` returns `#t`; otherwise it returns `#f`. 
     367 
    352368=== Copying and conversion === 
    353369