Equate string to lambda
Posted: Sun Apr 08, 2007 1:09 pm
I have input as a string. It will eventually be eval'd, but I want to verify that it is a lambda defined in a particular context - not necessarily the current context - before running it (i.e. to make sure that it was not code mapped in). The idea is to map segments of a url to definitions in a particular context. So, if I have a url like www.something.com/blah/yadda/foo/bar, it would verify that "blah" is a lambda in, for example, the context 'webpages, and then, if it is, eval something like (blah 'yadda 'foo 'bar). If I convert blah then to a symbol, it can only be validated as a symbol, and I obviously don't want to do something like (catch (eval "blah")), because that evals it without validation. And on top of that, I have a symbol (say, 'uri-seg1'), pointing to "blah". I'm a bit confused :(. Anyone have any advice?