List Evaluation 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 object to the end of the "Object Store." The "Return Value" is set to the reference, or location, of the new list 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 list 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 12 = "call_function_begin"
  • Value Stack at time 12 = [ [ 6, [ 4, [ 2, [ ] ] ] ], [ ] ]
  • the expression at time 12 = [2, 4, 6]

then Return Value at time (12 + 1) = Python reference (length of stack (Python Object Store at time 12))

Try stepping through the simulator to see the return value set to the location of the Python list object.

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Comments

Please log in to add comments