6.2.901.900
4 Hash Lenses
procedure
(hash-ref-lens key) → lens?
key : any/c Constructs a lens that targets hashes and views the value of key.
procedure
(hash-ref-nested-lens key ...) → lens?
key : any/c Contructs a lens that targets hashes with nested hashes as values and views the value obtained by using each key in order.
procedure
(hash-pick-lens key ...) → lens?
key : any/c Creates a lens that views a subset of the target hash-table with the given keys. The view, is another hash-table with only the given keys and their corrosponding values in the target hash-table.
Examples:
> (lens-view (hash-pick-lens 'a 'c) (hash 'a 1 'b 2 'c 3)) '#hash((a . 1) (c . 3))
> (lens-set (hash-pick-lens 'a 'c) (hash 'a 1 'b 2 'c 3) (hash 'a 4 'c 5)) '#hash((a . 4) (b . 2) (c . 5))