List Begin Arguments Property

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

then arguments stack at time (t + 1) = [ elements, arguments stack at time t ]

At the beginning of list evaluation, LW Python pushes the list elements into the "Arguments" stack. The purpose of this is to evaluate the elements one by one before evaluating the "parent" list container. This is analogous to function calls that push their arguments into the "Arguments" stack.

For example, if the following are true:

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

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

Try stepping through the simulator to see the list elements get pushed to the "Arguments Stack."

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Comments

Please log in to add comments