1.1 --- a/docs/invocation.txt Sun Jun 06 03:03:09 2010 +0200
1.2 +++ b/docs/invocation.txt Sun Jun 06 15:27:50 2010 +0200
1.3 @@ -163,13 +163,31 @@
1.4
1.5 Approach #2 - add arguments, add defaults while checking frame
1.6
1.7 -Defaults for lambda functions:
1.8 +Dynamic functions:
1.9
1.10 - f = lambda x, y=default: ...
1.11 + def f(x):
1.12 + def g(y=x): # dynamic: y depends on non-constant value
1.13 + ...
1.14 + def h(y=2): # static: y depends on constant value
1.15 + ...
1.16 +
1.17 + def f(x):
1.18 + g = lambda y=x: ... # dynamic: y depends on non-constant value
1.19 + h = lambda y=2: ... # static: y depends on constant value
1.20
1.21 - Defines instance of f with method:
1.22 +Representation of dynamic functions:
1.23 +
1.24 + f = lambda x, y=nonconst: ...
1.25 +
1.26 + def f(x, y=nonconst):
1.27 + ...
1.28
1.29 - def <lambda>(<context>, x, y=default):
1.30 + Defines instance with method:
1.31 +
1.32 + def <lambda>(<context>, x, y=nonconst):
1.33 + ...
1.34 +
1.35 + def f(<context>, x, y=nonconst):
1.36 ...
1.37
1.38 Where default is attribute #1.