2 ms·
Actually, would there be any real problem with keeping the map in a closure, and passing around a function that gets (or, with a second optional argument, sets)
by silentbicycle 18y ago
Actually, would there be any real problem with keeping the map in a closure, and passing around a function that gets (or, with a second optional argument, sets) the value for a given key?
(h 'key) and (h 'key 'new-val)
That's not too bad syntax-wise. Or, taking a cue from actor languages:
(h 'get 'key) and (h 'set 'key 'new-val)