diff options
Diffstat (limited to 'doc/docs/doc/README.md')
| -rwxr-xr-x | doc/docs/doc/README.md | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/doc/docs/doc/README.md b/doc/docs/doc/README.md index 7e9b454..a970baa 100755 --- a/doc/docs/doc/README.md +++ b/doc/docs/doc/README.md | |||
| @@ -3538,7 +3538,7 @@ with str := "Hello" | |||
| 3538 | </pre> | 3538 | </pre> |
| 3539 | </YueDisplay> | 3539 | </YueDisplay> |
| 3540 | 3540 | ||
| 3541 | Accessing special keys with `[]` in a `with` statement. | 3541 | You can access special keys with `[]` in a `with` statement. |
| 3542 | 3542 | ||
| 3543 | ```moonscript | 3543 | ```moonscript |
| 3544 | with tb | 3544 | with tb |
| @@ -3561,6 +3561,18 @@ with tb | |||
| 3561 | </pre> | 3561 | </pre> |
| 3562 | </YueDisplay> | 3562 | </YueDisplay> |
| 3563 | 3563 | ||
| 3564 | `with?` is an enhanced version of `with` syntax, which introduces an existential check to safely access objects that may be nil without explicit null checks. | ||
| 3565 | |||
| 3566 | ```moonscript | ||
| 3567 | with? obj | ||
| 3568 | print obj.name | ||
| 3569 | ``` | ||
| 3570 | <YueDisplay> | ||
| 3571 | <pre> | ||
| 3572 | with? obj | ||
| 3573 | print obj.name | ||
| 3574 | </pre> | ||
| 3575 | </YueDisplay> | ||
| 3564 | 3576 | ||
| 3565 | ## Do | 3577 | ## Do |
| 3566 | 3578 | ||
