Fwd: use "as" for block scope support

1. but what about ( t * s + t / s )? temp var always keep in memory. (should not reduce ( t + s ) to ( 2 * x ) since x, y may not a number. any operator here should be conside as independent function. ) 2. try convert this to the lambda form: (x+y as t, x-y as s)(t * s as u, t/s as v)(u << v as p, u>>v as q) p ** q In runtime: lambda = MAKE_FUNCTION/MAKE_CLOSURE = PyFunction_New lambda call = CALL_FUNCTION = PyFrame_New + PyEval_EvalFrameEx all of them are heavy, (you can check the source code) but: as = PyCell_New as enter = SETUP_FINALLY = PyFrame_BlockSetup as leave = END_FINALLY = PyFrame_BlockPop which is much much much more more more cheaper than above. 2011/7/26 Bruce Leban <bruce@leapyear.org>:

在 2011年7月26日 上午2:56,海韵 <lyricconch@gmail.com> 写道: try convert this to the lambda form: R = lamba x, y: (x+y as t, x-y as s)(t * s as u, t/s as v)(u << v as p, u>>v as q) p ** q using "as" can make lambda expression more graceful.

在 2011年7月26日 上午2:56,海韵 <lyricconch@gmail.com> 写道: try convert this to the lambda form: R = lamba x, y: (x+y as t, x-y as s)(t * s as u, t/s as v)(u << v as p, u>>v as q) p ** q using "as" can make lambda expression more graceful.
participants (1)
-
海韵