Call Function Line Property

If the state is "call_build_args" and the function parameter list is empty at time t, then at time t + 1, the current line is updated to the first line of the function body. More formally,

if the following are true:
  • expression state at time t = "call_build_args"
  • Parameters List at time t = [ ]
  • the expression at time t = function call with name: name and arguments: args
  • there is a function named name with parameters params at line line

then the line at time (t + 1) = line + 1

When the state is "call_build_args" and the function parameter list is empty, Python has finished constructing the function variables map, and it is ready to start executing the function body. Thus, Python updates the line to the first line in the function body.

For example, if the following are true:

  • expression state at time 12 = "call_build_args"
  • Parameters List at time 12 = [ ]
  • the expression at time 12 = add_three(a)
  • there is a function named "add_three" with parameters [ x, [ ] ] at line 1

then the line at time 13 = 1 + 1

Try stepping through the simulator to see the current line change to 2.

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Comments

Please log in to add comments