1.1 --- a/translator.py Fri Jan 20 22:02:42 2017 +0100
1.2 +++ b/translator.py Fri Jan 20 22:03:27 2017 +0100
1.3 @@ -1282,15 +1282,22 @@
1.4
1.5 if target:
1.6 stages.append(target)
1.7 +
1.8 + # Methods accessed via unidentified accessors are obtained.
1.9 +
1.10 elif function:
1.11 self.record_temp("__tmp_targets")
1.12 stages.append("__load_via_object(__tmp_targets[%d].value, %s).fn" % (
1.13 self.function_target, encode_symbol("pos", "__fn__")))
1.14
1.15 # With a known target, the function is obtained directly and called.
1.16 + # By putting the invocation at the end of the final element in the
1.17 + # instruction sequence (the stages), the result becomes the result of
1.18 + # the sequence. Moreover, the parameters become part of the sequence
1.19 + # and thereby participate in a guaranteed evaluation order.
1.20
1.21 if target or function:
1.22 - output = "(\n%s\n)(%s)" % (",\n".join(stages), argstr)
1.23 + output = "(\n%s(%s))" % (",\n".join(stages), argstr)
1.24
1.25 # With unknown targets, the generic invocation function is applied to
1.26 # the callable and argument collections.