diff options
author | Li Jin <dragon-fly@qq.com> | 2025-05-21 18:10:32 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2025-05-21 18:10:32 +0800 |
commit | b21621692e877e5a44508b90049c2bc75091ebac (patch) | |
tree | 8adecb25d6a955d23cc55dbcf9d4867b2918eec9 /doc/docs | |
parent | 040f6802ef02f6541e0213de0440f9b1b758d9fc (diff) | |
download | yuescript-b21621692e877e5a44508b90049c2bc75091ebac.tar.gz yuescript-b21621692e877e5a44508b90049c2bc75091ebac.tar.bz2 yuescript-b21621692e877e5a44508b90049c2bc75091ebac.zip |
Allowed backcall without parentheses.v0.28.2
Diffstat (limited to 'doc/docs')
-rwxr-xr-x | doc/docs/doc/README.md | 10 | ||||
-rwxr-xr-x | doc/docs/zh/doc/README.md | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/doc/docs/doc/README.md b/doc/docs/doc/README.md index 502f7b6..4a408fe 100755 --- a/doc/docs/doc/README.md +++ b/doc/docs/doc/README.md | |||
@@ -1925,22 +1925,22 @@ x * 2 | |||
1925 | </pre> | 1925 | </pre> |
1926 | </YueDisplay> | 1926 | </YueDisplay> |
1927 | 1927 | ||
1928 | If you wish to have further code after your backcalls, you can set them aside with a do statement. | 1928 | If you wish to have further code after your backcalls, you can set them aside with a do statement. And the parentheses can be omitted with non-fat arrow functions. |
1929 | 1929 | ||
1930 | ```moonscript | 1930 | ```moonscript |
1931 | result, msg = do | 1931 | result, msg = do |
1932 | (data) <- readAsync "filename.txt" | 1932 | data <- readAsync "filename.txt" |
1933 | print data | 1933 | print data |
1934 | (info) <- processAsync data | 1934 | info <- processAsync data |
1935 | check info | 1935 | check info |
1936 | print result, msg | 1936 | print result, msg |
1937 | ``` | 1937 | ``` |
1938 | <YueDisplay> | 1938 | <YueDisplay> |
1939 | <pre> | 1939 | <pre> |
1940 | result, msg = do | 1940 | result, msg = do |
1941 | (data) <- readAsync "filename.txt" | 1941 | data <- readAsync "filename.txt" |
1942 | print data | 1942 | print data |
1943 | (info) <- processAsync data | 1943 | info <- processAsync data |
1944 | check info | 1944 | check info |
1945 | print result, msg | 1945 | print result, msg |
1946 | </pre> | 1946 | </pre> |
diff --git a/doc/docs/zh/doc/README.md b/doc/docs/zh/doc/README.md index e5efe3b..d7b8361 100755 --- a/doc/docs/zh/doc/README.md +++ b/doc/docs/zh/doc/README.md | |||
@@ -1886,22 +1886,22 @@ x * 2 | |||
1886 | </pre> | 1886 | </pre> |
1887 | </YueDisplay> | 1887 | </YueDisplay> |
1888 | 1888 | ||
1889 | 如果你希望在反向回调处理后继续编写更多其它的代码,你可以使用do语句将不归属反向回调的代码分开。 | 1889 | 如果你希望在反向回调处理后继续编写更多其它的代码,可以使用 do 语句将不属于反向回调的代码分隔开。对于非粗箭头函数的反向回调,回调返回值的括号也是可以省略的。 |
1890 | 1890 | ||
1891 | ```moonscript | 1891 | ```moonscript |
1892 | result, msg = do | 1892 | result, msg = do |
1893 | (data) <- readAsync "文件名.txt" | 1893 | data <- readAsync "文件名.txt" |
1894 | print data | 1894 | print data |
1895 | (info) <- processAsync data | 1895 | info <- processAsync data |
1896 | check info | 1896 | check info |
1897 | print result, msg | 1897 | print result, msg |
1898 | ``` | 1898 | ``` |
1899 | <YueDisplay> | 1899 | <YueDisplay> |
1900 | <pre> | 1900 | <pre> |
1901 | result, msg = do | 1901 | result, msg = do |
1902 | (data) <- readAsync "文件名.txt" | 1902 | data <- readAsync "文件名.txt" |
1903 | print data | 1903 | print data |
1904 | (info) <- processAsync data | 1904 | info <- processAsync data |
1905 | check info | 1905 | check info |
1906 | print result, msg | 1906 | print result, msg |
1907 | </pre> | 1907 | </pre> |