summaryrefslogtreecommitdiff
path: root/doc/yue-en.md
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2026-02-28 18:03:14 +0800
committerLi Jin <dragon-fly@qq.com>2026-02-28 18:03:14 +0800
commit29db60797bd74656b57a0f20778c76adc78095ac (patch)
treee7e54bb45011bb1dc5ba159c80dfffd396a61eed /doc/yue-en.md
parent394ee0f64a0dc022f1dab86213d4771982ecf987 (diff)
downloadyuescript-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.md10
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
509The @ prefix on a variable name is shorthand for self.. @items becomes self.items. 509The @ prefix on a variable name is shorthand for self.. @items becomes self.items.
510 510
511The class block also supports metatable fields by writing metamethod keys in angle brackets, such as `<tostring>`.
512
513```yuescript
514class User
515 new: (@name) =>
516 <tostring>: => "User(#{@name})"
517
518print tostring User "Yue"
519```
520
511Creating an instance of the class is done by calling the name of the class as a function. 521Creating an instance of the class is done by calling the name of the class as a function.
512 522
513```yuescript 523```yuescript