Dictionary Evaluation Property
After the dictionary entries have been evaluated and stored in the "Values" stack, LW Python creates a new Python dictionary object with the stack values and appends this object to the end of the "Object Store." The "Return Value" is set to the reference, or location, of the new dictionary object in the "Object Store." More formally,
if the following are true:
- expression state at time t = "call_function_begin"
- Value Stack at time t = [ values, stack ]
- the expression at time t = Python dictionary elements
then Return Value at time (t + 1) = Python reference (length of stack (Python Object Store at time t))
For example,
if the following are true:
- expression state at time 25 = "call_function_begin"
- Value Stack at time 25 = [ [ entry "MX": "Mexico", [ entry "ES": "Spain", [ ] ] ], [ ] ]
- the expression at time 25 =
{"ES": "Spain", "MX": "Mexico"}
then Return Value at time (25 + 1) = Python reference (length of stack (Python Object Store at time 25))
Try stepping through the simulator to see the object get added to the "Object Store."
Current Line | 1 | Current Tab | 0 | Time | 0 |
Comments
Please log in to add comments