From 8ba4523cccf59093543cec988b07957193d55692 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 10 Apr 2019 12:58:14 -0300 Subject: 'print' does not call 'tostring' to format its arguments --- manual/manual.of | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'manual') diff --git a/manual/manual.of b/manual/manual.of index 9f1ef631..6da2e494 100644 --- a/manual/manual.of +++ b/manual/manual.of @@ -6143,8 +6143,10 @@ In case of any error, @id{pcall} returns @false plus the error object. @LibEntry{print (@Cdots)| Receives any number of arguments and prints their values to @id{stdout}, -using the @Lid{tostring} function to convert each argument to a string. -@id{print} is not intended for formatted output, +converting each argument to a string +following the same rules of @Lid{tostring}. + +The function @id{print} is not intended for formatted output, but only as a quick way to show a value, for instance for debugging. For complete control over the output, @@ -8772,6 +8774,13 @@ like any other error when calling a finalizer.) @sect2{@title{Incompatibilities in the Libraries} @itemize{ +@item{ +The function @Lid{print} does not call @Lid{tostring} +to format its arguments; +instead, it has this functionality hardwired. +You should use @id{__tostring} to modify how values are printed. +} + @item{ The pseudo-random number generator used by the function @Lid{math.random} now starts with a somewhat random seed. -- cgit v1.2.3-55-g6feb