List Evaluation Object Property

After the list elements have been evaluated and stored in the "Values" stack, LW Python creates a new Python list object with the stack values and appends this list 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 list elements

then Python Object Store at time (t + 1) = result of appending (Python list (reverse of values)) to (Python Object Store at time t)

The list and its contents are stored in the "Object Store." If this list is assigned to a variable, then the variable's value is the location of the list object in the Object Store. For example, if the following are true:

  • expression state at time 12 = "call_function_begin"
  • Value Stack at time 12 = [ [ 6, [ 4, [ 2, [ ] ] ] ], [ ] ]
  • the expression at time 12 = [2, 4, 6]

then Python Object Store at time (12 + 1) = result of appending (Python list (reverse of [ 6, [ 4, [ 2, [ ] ] ] ])) to (Python Object Store at time 12)

Try stepping through the simulator to see LW Python append the new list to the "Object Store."

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Comments

Please log in to add comments