I recently wrote for(i in 1:100){foo(i,bar)} as the last line in a script. In this case, the last line of foo is a call to print and I
for(i in 1:100){foo(i,bar)}
foo
print