Mercurial Hosting > luan
comparison website/src/manual.html.luan @ 429:e3a6d9dbd694
rename __tostring to __to_string
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Sat, 02 May 2015 20:13:24 -0600 |
| parents | df95199ca4c0 |
| children | eddf7c73373b |
comparison
equal
deleted
inserted
replaced
| 428:df95199ca4c0 | 429:e3a6d9dbd694 |
|---|---|
| 2288 (For complete control of how numbers are converted, | 2288 (For complete control of how numbers are converted, |
| 2289 use <a href="#pdf-string.format"><code>string.format</code></a>.) | 2289 use <a href="#pdf-string.format"><code>string.format</code></a>.) |
| 2290 | 2290 |
| 2291 | 2291 |
| 2292 <p> | 2292 <p> |
| 2293 If the metatable of <code>v</code> has a <code>"__tostring"</code> field, | 2293 If the metatable of <code>v</code> has a <code>"__to_string"</code> field, |
| 2294 then <code>tostring</code> calls the corresponding value | 2294 then <code>tostring</code> calls the corresponding value |
| 2295 with <code>v</code> as argument, | 2295 with <code>v</code> as argument, |
| 2296 and uses the result of the call as its result. | 2296 and uses the result of the call as its result. |
| 2297 | 2297 |
| 2298 | 2298 |
| 5227 | 5227 |
| 5228 <p> | 5228 <p> |
| 5229 In case of unprotected errors in the script, | 5229 In case of unprotected errors in the script, |
| 5230 the interpreter reports the error to the standard error stream. | 5230 the interpreter reports the error to the standard error stream. |
| 5231 If the error object is not a string but | 5231 If the error object is not a string but |
| 5232 has a metamethod <code>__tostring</code>, | 5232 has a metamethod <code>__to_string</code>, |
| 5233 the interpreter calls this metamethod to produce the final message. | 5233 the interpreter calls this metamethod to produce the final message. |
| 5234 Otherwise, the interpreter converts the error object to a string | 5234 Otherwise, the interpreter converts the error object to a string |
| 5235 and adds a stack traceback to it. | 5235 and adds a stack traceback to it. |
| 5236 | 5236 |
| 5237 | 5237 |
