Dictionary Begin Arguments Property

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

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

At the beginning of dictionary evaluation, LW Python pushes the dictionary entries into the "Arguments" stack. The purpose of this is to evaluate the entry keys and values one by one before evaluating the "parent" dictionary 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) = {"ES": "Spain", "MX": "Mexico"}
then (arguments stack at time (1 + 1)) = [ [ entry "ES":"Spain", [ entry "MX":"Mexico", [ ] ] ], arguments stack at time 1 ]

Try stepping through the simulator to see the dictionary entries get pushed to the "Arguments Stack."

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Comments

Please log in to add comments