Re:The Universal Design Pattern
by gcv on Monday October 20, 2008 @02:52PM
(#338186)
Don't know if this will do what you want, but these two reader macros add syntactic sugar for Common Lisp's aref and gethash forms. You should put these definitions in an eval-when. Disclaimer: I haven't used these in a while (not programming in Lisp at the moment, alas), so they may have some limitations which I have forgotten.
[ Parent
| on HN ]
Re:The Universal Design Pattern
by silentbicycle on Monday October 20, 2008 @03:18PM
(#338212)
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)