Contexts question
Posted: Thu May 24, 2007 8:20 pm
When applying a function defined in a context to a table defined outside of that context, how can you do assoc lookups? For example:
some-fn may be used from various contexts. In order to lookup key-a, it must know which context we are coming from. I can do a (name table true), but then to get the correct symbol to look up, I'm forced to do something like:
...which is incredibly verbose syntax just for a table lookup. Anyone have a solution?
Code: Select all
(context 'foo)
(define (some-fn table)
(lookup 'key-a table))
(context 'bar)
(some-fn '((key-a "value-a") (key-b "value-b")))
Code: Select all
(eval-string (format "%s:key-a" (string (name table true)))