André Thieme a écrit : > Paul Rubin schrieb: >> André Thieme <[EMAIL PROTECTED]> writes: >>>> import module >>>> module.function = memoize(module.function) >>> Yes, I mentioned that a bit earlier in this thread (not about the >>> "during runtime" thing). >>> I also said that many macros only save some small bits of code. >>> Your python example contains 4 tokens / brain units. >>> The Lisp version only has 2. >> >> You shouldn't count the import statement, since you'd need the >> equivalent in Lisp as well. > > I didn't count it. > > 1P) module.function > 2P) = > 3P) memoize( > 4P) module.function) > > vs > 1L) (memoize > 2L) function) > > I counted 1P and 4P only as one (each) although it should have been 2 > for each. But it would have worked too if we didn't need the "module.": > function = memoize(function).
If you really need to : memoize('module.function') but it's ugly. -- http://mail.python.org/mailman/listinfo/python-list