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

想到一种switch语句的实现 #53

Open
SilasFan opened this issue Dec 18, 2019 · 6 comments
Open

想到一种switch语句的实现 #53

SilasFan opened this issue Dec 18, 2019 · 6 comments
Labels
syntax Suggestions to improve the syntax

Comments

@SilasFan
Copy link

简单地来自最熟悉的论语😂

吾日省「吾身」:
    其「七十七」乎?
            代码块一。
            乃止。
    其「六十六」乎?
            代码块二。
            乃止。
    若非也:
            代码块三。

临时起意想到的,还可以改一下,比如:

  1. “日省”可以改为“省”,因为加了“日”就有了一种是在循环之中的次序的感觉
  2. 因为case后面加的都是值,所以原文中没有“其”,我给加上了,感觉通顺一点
  3. 最后那个default翻译成“若非也”好像不是很妥当,但是我一时也想不到更好的了,见谅😂
@LingDong-
Copy link
Member

Nice! Thanks! I like the idea. Will consider adding it to the syntax. Perhaps 竟皆非乎 for default? :-P

@SilasFan
Copy link
Author

想到一个弗向者乎 for default
竟皆非乎其实也不错,但是感觉“竟”带了一点情感hhh,用在这里好像有点怪怪的😂😂
另外看到其他issue里有说《九章算术》的,可以统一一下格式,把首句改为:
今有「吾身」者:
或者:
吾有「吾身」者:

@LingDong-
Copy link
Member

LingDong- commented Dec 18, 2019

You're right. But I'm using in the sense of "in the end" not as in "unexpectedly".
Also, please see https://github.com/LingDong-/wenyan-lang/pull/35
It turns out

“弗”是“不之”的合音字,後面要跟及物動詞

I learned that today. ;) So probably it needs to be
非向者乎
OR
向者皆不是乎

Thanks again for your suggestions!

@KagurazakaHanabi
Copy link

个人认为就不要加上 break 了避免太过冗长,参考下 Swift 的 fallthrough

@yxiao009
Copy link

yxiao009 commented Dec 20, 2019

省「吾身」:
其「一」:
述一。
其「二」:
述二。
逋欠:
补缺。

@LingDong- LingDong- added the syntax Suggestions to improve the syntax label Dec 24, 2019
@lymslive
Copy link

其一
其二
其余 // for default
如何?

另赞同干掉 break

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

5 participants