| On line 24 of app.arc, we have: ; idea: a bidirectional table, so don't need two vars (and sets)
(= cookie->user* (table) user->cookie* (table) logins* (table))
Well, with the magic of settable-fn or settable-fn2, pg's idea has been made real. Get it from arc-wiki.git, load "lib/bidir-table", and: arc> (= test (bidir-table))
#4(....)
arc> (= test!x 'y)
y
arc> test!x
y
arc> test!y
x
arc> (= test!y 42)
42
arc> test!42
y
arc> test!x
nil
Caveat: (keys ...) on a bidir-table will only return those objects that were assigned to in key position. This is in order to prevent 'maptable from going through pairs twice. |