Dictionary Evaluation Object 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 dictionary to the end of 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 Python Object Store at time (t + 1) = result of appending (Python dictionary (reverse of values)) to (Python Object Store at time t)
- (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"}
Try stepping through the simulator to see the object get added to the "Object Store."
Code Editor
LW Python State
Current Line | 1 | Current Tab | 0 | Time | 0 |
LW Python Simulator
Comments
Please log in to add comments