1.1 --- a/docs/invocation.txt Fri Jun 03 01:33:04 2011 +0200
1.2 +++ b/docs/invocation.txt Mon Jun 06 00:48:40 2011 +0200
1.3 @@ -136,6 +136,16 @@
1.4 1 -> argument #3
1.5 2 -> argument #4
1.6
1.7 + f(obj, 1, 2) # f known at compile-time
1.8 +
1.9 + f -> C.__new__ (known and called at run-time)
1.10 + -> argument #1 left blank
1.11 + obj -> argument #2
1.12 + 1 -> argument #3
1.13 + 2 -> argument #4
1.14 +
1.15 +Frame re-use in instantiators:
1.16 +
1.17 Need to call C.__init__(<instance>, obj, 1, 2), preferably with the existing
1.18 frame:
1.19
1.20 @@ -146,6 +156,10 @@
1.21
1.22 Then jump without switching frames.
1.23
1.24 + If no context argument (or blank argument) were provided, a new frame would
1.25 + need to be allocated and filled with a new instance and all remaining
1.26 + arguments from the current frame.
1.27 +
1.28 Defaults for unknown callables:
1.29
1.30 f(obj) # f not known at compile-time
2.1 --- a/rsvplib.py Fri Jun 03 01:33:04 2011 +0200
2.2 +++ b/rsvplib.py Mon Jun 06 00:48:40 2011 +0200
2.3 @@ -380,7 +380,10 @@
2.4 frame = self.local_sp_stack[-1]
2.5
2.6 # Get the sequence address.
2.7 - # The first argument should be empty.
2.8 + # The first argument should be empty since this function acts as an
2.9 + # instantiator, and in instantiators the first argument is reserved so
2.10 + # that it can be filled in for the call to an initialiser without
2.11 + # allocating a new frame.
2.12
2.13 obj_value = self.frame_stack[frame + 1]
2.14 return self._builtins_tuple(obj_value)