-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ANNOUNCEMENT] Try-Catch block #399
Comments
Is it a typo in JavaScript code that all conditions are the same? |
Thanks @liyishuai you're right, just fixed the typo :P |
今天读到 “姑妄行此” 我觉得用 “姑妄行是” 好此,用“是”表示“此”“如下”更有点古意。或者就按原 #275 的提议用”姑妄行之“。 当然,这已经是细枝末节了。 之前的 issue 有提到用”省“字表达
也许”姑妄“用在 |
@lymslive , interesting suggestions!
|
@lymslive Guess the main reason @LingDong- don't use “姑妄行之” is that “之” has already been fixed as a keyword to reference the latest calculated/assigned variable. |
Maybe this should be added to the syntax cheatsheet? @LingDong- @antfu |
Good suggestion. It would be great if you can help out on our wiki https://github.com/wenyan-lang/wiki Thank you! |
Hi everyone, as requested by #275 and #358 , try-catch is here! Here is an overview of the syntax:
Which is roughly equivelent to this JavaScript:
If you do not need to catch the errors, you can do:
Which roughly equals to:
You can also do this to catch any error:
Which roughly equals to:
You can see details about the usage in
./examples/try.wy
.Please let me know what you think or found any issues! Thanks a lot!
The text was updated successfully, but these errors were encountered: