Breakpoints

A breakpoint is an an intentional pausing place in a program for debugging purpose. It is a means of getting information about a program during its execution. During the interruption, you can check whether the program is functioning as expected. In Smojo, we use the word
BP
to place a breakpoint in the code.
	: addition
		bp
		+ bp cr
		"The sum is " . . cr bp
	;

	5 2 addition

	--breakpoint: ADDITION[1] -- 
	<2> 5 2 

	--breakpoint: ADDITION[2] -- 
	<1> 7 

	The sum is  7 

	--breakpoint: ADDITION[3] -- 
	<0> 
	ok
	

Quiz

Question 1

Run the
ADDITION
program. Can you explain what happens at the three different breakpoints?



Next: Conditionals I