You're free to use either one, but consider:
-- Only print is "redirectable":
print to someTextWriter
.doThis
.doThat
Within the execution of the "print to" block, all output will go to someTextWriter instead of to the console. It's roughly equivalent to:
CobraImp.pushPrintDestination(someTextWriter)
try
.doThis
.doThat
finally
CobraImp.popPrintDestination
-- As Cobra migrates to other platforms such as Java, Parrot, Android, etc. only "print" will be guaranteed to continue to work.
For the above reasons, I think "print" is a better choice.
And just for reference:
# to point just one print statement to a text writer:
print to someTextWrite, "hello", foo, bar
# to avoid the new line
print "hello" stop