diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-02-28 18:03:14 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-02-28 18:03:14 +0800 |
| commit | 29db60797bd74656b57a0f20778c76adc78095ac (patch) | |
| tree | e7e54bb45011bb1dc5ba159c80dfffd396a61eed /doc/yue-en.md | |
| parent | 394ee0f64a0dc022f1dab86213d4771982ecf987 (diff) | |
| download | yuescript-0.33.7.tar.gz yuescript-0.33.7.tar.bz2 yuescript-0.33.7.zip | |
Fixed destructuring with empty and comment lines in table issue. Updated docs.v0.33.7
Diffstat (limited to 'doc/yue-en.md')
| -rw-r--r-- | doc/yue-en.md | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/yue-en.md b/doc/yue-en.md index 6680281..8f8370d 100644 --- a/doc/yue-en.md +++ b/doc/yue-en.md | |||
| @@ -508,6 +508,16 @@ Notice how all the methods in the class use the fat arrow function syntax. When | |||
| 508 | 508 | ||
| 509 | The @ prefix on a variable name is shorthand for self.. @items becomes self.items. | 509 | The @ prefix on a variable name is shorthand for self.. @items becomes self.items. |
| 510 | 510 | ||
| 511 | The class block also supports metatable fields by writing metamethod keys in angle brackets, such as `<tostring>`. | ||
| 512 | |||
| 513 | ```yuescript | ||
| 514 | class User | ||
| 515 | new: (@name) => | ||
| 516 | <tostring>: => "User(#{@name})" | ||
| 517 | |||
| 518 | print tostring User "Yue" | ||
| 519 | ``` | ||
| 520 | |||
| 511 | Creating an instance of the class is done by calling the name of the class as a function. | 521 | Creating an instance of the class is done by calling the name of the class as a function. |
| 512 | 522 | ||
| 513 | ```yuescript | 523 | ```yuescript |
