List Begin Parent Property

if the following are true:
  • expression state at time t = "begin_expr"
  • the expression at time t = Python list elements

then parent stack at time (t + 1) = [ Python list elements, parent stack at time t ]

At the beginning of list (or any other expression) evaluation, LW Python pushes the expression into the parent stack. This is to save the expression somewhere while LW Python first evaluates the children (list elements).

For example, if the following are true:

  • expression state at time 1 = "begin_expr"
  • the expression at time 1 = [2, 4, 6]
  • parent stack at time 1 = [ ]

then parent stack at time (1 + 1) = [ [2, 4, 6], parent stack at time 1 ]

Try stepping through the simulator to see LW Python push the list into the "Parent Stack."

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Comments

Please log in to add comments