Call Build Arguments Rule

When the state is "call_build_args," add a new entry to the "Function Variables" map, where the key is the first element in the "Parameters" list and the value is the first element of the "Values" list.

if the following are true:
  • expression state at time t = "call_build_args"
  • Parameters List at time t = [ var, frest ]
  • Argument Values at time t = [ value, vrest ]

then Function Variables Map at time (t + 1) = result of storing value at key: var in map: (Function Variables Map at time t)

When the state is "call_build_args," Python constructs the "Function Variables" map from function parameters and evaluated arguments. This temporary map becomes the "Variables" map when the function is executing.

For example, if the following are true:

  • expression state at time 11 = "call_build_args"
  • Function Variables Map at time 11 = [ ]
  • Parameters List at time 11 = [ x, [ ] ]
  • Argument Values at time 11 = [ 5, [ ] ]

then Function Variables Map at time 12 = [ pair (x, 5), [ ] ]

Try stepping through the simulator to see LW Python populate the "Function Variables" map.

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Comments

Please log in to add comments