diff options
Diffstat (limited to 'doc/docs/doc/README.md')
-rwxr-xr-x | doc/docs/doc/README.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/docs/doc/README.md b/doc/docs/doc/README.md index f6aebfc..83d351f 100755 --- a/doc/docs/doc/README.md +++ b/doc/docs/doc/README.md | |||
@@ -1313,6 +1313,22 @@ print "OK" | |||
1313 | </pre> | 1313 | </pre> |
1314 | </YueDisplay> | 1314 | </YueDisplay> |
1315 | 1315 | ||
1316 | ### While Assignment | ||
1317 | |||
1318 | You can also use if assignment in a while loop to get the value as the loop condition. | ||
1319 | ```moonscript | ||
1320 | while byte := stream\read_one! | ||
1321 | -- do something with the byte | ||
1322 | print byte | ||
1323 | ``` | ||
1324 | <YueDisplay> | ||
1325 | <pre> | ||
1326 | while byte := stream\read_one! | ||
1327 | -- do something with the byte | ||
1328 | print byte | ||
1329 | </pre> | ||
1330 | </YueDisplay> | ||
1331 | |||
1316 | ## Varargs Assignment | 1332 | ## Varargs Assignment |
1317 | 1333 | ||
1318 | You can assign the results returned from a function to a varargs symbol `...`. And then access its content using the Lua way. | 1334 | You can assign the results returned from a function to a varargs symbol `...`. And then access its content using the Lua way. |