Call Constructor State Property

After the arguments have been evaluated, prepare for a method call by moving to the "call_build_args" state. More formally,

if the following are true:
  • expression state at time t = "call_function_begin"
  • Value Stack at time t = [ evaluated, stack ]
  • the expression at time t = Python constructor with name: class_name and arguments: args

then expression state at time (t + 1) = "call_build_args"

For example, if the following are true:
  • expression state at time 20 = "call_function_begin"
  • Value Stack at time 20 = [ [ 25, [ "Smith", [ "John", [ ] ] ] ], [ ] ]
  • the expression at time 20 = Person("John", "Smith", 25)

then expression state at time (20 + 1) = "call_build_args"

Try stepping through the simulator to see LW Python move to the "call_build_args" state.

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Comments

Please log in to add comments