Skip to content
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

语感建议:若其者 --> 若其阳者 #513

Open
lymslive opened this issue Jan 10, 2020 · 3 comments
Open

语感建议:若其者 --> 若其阳者 #513

lymslive opened this issue Jan 10, 2020 · 3 comments
Labels
syntax Suggestions to improve the syntax

Comments

@lymslive
Copy link

在读 stdlib 一些代码,感觉
“若其者”读之太不顺,建议
“若其阳者”表示 if(most_recent_var)
若其阴者”表示 if(!most_recent_var)

@LingDong-
Copy link
Member

LingDong- commented Jan 10, 2020

You're right! 若其阳者 reads more smoothly. I'll definitely consider adding this.

Notice that 若其等於陽者 若其等於陰者 is already supported and does (almost) exactly the same thing. 若其者 is just a shorthand and is arguably a stylistic choice. Only difference is if(!a) and if(a) do a typecast from any type to bool, which, now that wenyan-lang is stricter on types, we need to consider how we want to handle this.

Thanks for bringing this up!

EDIT: another possibility is to use 若其然者 若其不然者. This way we don't change the semantic meaning of and to accommodate one new syntax, and the expressions will be arguably more common in classical Chinese.

@LingDong- LingDong- added the syntax Suggestions to improve the syntax label Jan 10, 2020
@antfu antfu mentioned this issue Jan 11, 2020
@cuixiping
Copy link
Contributor

I like 若其然者 若其不然者

@hustcer
Copy link

hustcer commented Jan 19, 2020

若其是者,若其非者?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
syntax Suggestions to improve the syntax
Projects
None yet
Development

No branches or pull requests

4 participants