On 03 Dec 2002 23:17:54 -0600, Tim Legant <[EMAIL PROTECTED]> wrote: > Here's the beginning of the problem, though. Because of namespaces, > which are a wonderful and powerful organizational mechanism in a > programming language, the above would actually be something like this: > > from TMDA import Message > from TMDA import Action
<snipped> Or we could manufacture a namespace to cater to the filter file. This wouldn't have to be done if we are using the Python filter as an intermediary format because who cares if it is wordy? But if we wanted to encourage people to write Python filters, we could do something like this very silly example: $ cat filter.py def filter(): if cond: do_something() $ cat try_filter.py import filter def do_something(): print "Yay! We did something!" cond = 1 filter.do_something = do_something filter.cond = cond filter.filter() $ python try_filter.py Yay! We did something! Obviously this takes a little tedious code in try_filter to create the right environment, but look how simple and clean it makes filter.py. Again, I'm not suggesting we do this. I'm only stating that we could, in hopes of sparking new ideas. P.S. Thanks to everyone for being so receptive to my whacky thoughts. It is (sadly) refreshing. :) Gre7g. _________________________________________________ tmda-workers mailing list ([EMAIL PROTECTED]) http://tmda.net/lists/listinfo/tmda-workers
