






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







%ns
puts “Hello!” Hello! set a 5 set b 4 set c [expr $a + $b] puts “The sum of $a and $b is $c”
proc print_list {list}{ set count 0 foreach element $list { incr count puts $element } return $count } set list1 {a, b, c} set num_elements [print_list $list]
Bun instproc toast {} { $self instvar toasted incr toasted if {$toasted>1} then { error "something's burning!" } return {} } $abun toast $abun toast something's burning!