diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-04-10 12:58:14 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-04-10 12:58:14 -0300 |
commit | 8ba4523cccf59093543cec988b07957193d55692 (patch) | |
tree | 761eb3efbdbe54372d8d5486c2469c337be1f8a8 /manual | |
parent | 979ad95eb114d8d43f928b184f051ac0cfacedf7 (diff) | |
download | lua-8ba4523cccf59093543cec988b07957193d55692.tar.gz lua-8ba4523cccf59093543cec988b07957193d55692.tar.bz2 lua-8ba4523cccf59093543cec988b07957193d55692.zip |
'print' does not call 'tostring' to format its arguments
Diffstat (limited to 'manual')
-rw-r--r-- | manual/manual.of | 13 |
1 files changed, 11 insertions, 2 deletions
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. | |||
6143 | @LibEntry{print (@Cdots)| | 6143 | @LibEntry{print (@Cdots)| |
6144 | Receives any number of arguments | 6144 | Receives any number of arguments |
6145 | and prints their values to @id{stdout}, | 6145 | and prints their values to @id{stdout}, |
6146 | using the @Lid{tostring} function to convert each argument to a string. | 6146 | converting each argument to a string |
6147 | @id{print} is not intended for formatted output, | 6147 | following the same rules of @Lid{tostring}. |
6148 | |||
6149 | The function @id{print} is not intended for formatted output, | ||
6148 | but only as a quick way to show a value, | 6150 | but only as a quick way to show a value, |
6149 | for instance for debugging. | 6151 | for instance for debugging. |
6150 | For complete control over the output, | 6152 | For complete control over the output, |
@@ -8773,6 +8775,13 @@ like any other error when calling a finalizer.) | |||
8773 | @itemize{ | 8775 | @itemize{ |
8774 | 8776 | ||
8775 | @item{ | 8777 | @item{ |
8778 | The function @Lid{print} does not call @Lid{tostring} | ||
8779 | to format its arguments; | ||
8780 | instead, it has this functionality hardwired. | ||
8781 | You should use @id{__tostring} to modify how values are printed. | ||
8782 | } | ||
8783 | |||
8784 | @item{ | ||
8776 | The pseudo-random number generator used by the function @Lid{math.random} | 8785 | The pseudo-random number generator used by the function @Lid{math.random} |
8777 | now starts with a somewhat random seed. | 8786 | now starts with a somewhat random seed. |
8778 | Moreover, it uses a different algorithm. | 8787 | Moreover, it uses a different algorithm. |