prn used alone would have a return value of simply "hello, ". With tostring, the return value is "hello, world\n".
Though it might be worth noting that in the source file, arc.arc, there looks to be the beginnings of a printf-like function:
(let argsym (uniq)
(def parse-format (str)
(rev (accum a
(with (chars nil i -1)
(w/instring s str
(whilet c (readc s)
(case c
#\# (do (a (coerce (rev chars) 'string))
(nil! chars)
(a (read s)))
#\~ (do (a (coerce (rev chars) 'string))
(nil! chars)
(readc s)
(a (list argsym (++ i))))
(push c chars))))
(when chars
(a (coerce (rev chars) 'string)))))))
(mac prf (str . args)
`(let ,argsym (list ,@args)
(pr ,@(parse-format str))))
)
So that you could say, apparently:
(let var "world"
(prf "hello, ~" var))
Granted, the hello world example isn't very illuminating as to the benefits of using prf over the regular pr / prn. But, hey, the option's there in some base form (after all, the code's rather experimental at this stage).
I suspect it is a debugging thing. Since pr and prn return their first argument verbatim you can put them in the middle of working code to find what the return value of something is, without breaking anything. As a trivial example:
(+ (prn 2) 3) ; prints 2 and returns 5
Maybe you wouldn't need it if you had a fancy debugging suite, but it can be useful if you are debugging manually.
I think the reason is that returning the concatenation would be very expensive. It would basically require a temporary write stream just to put together the return value. In the majority of cases, the return value is probably not even used.
To get the effect you want, simply concatenate as a separate step: