GithubHelp home page GithubHelp logo

Comments (3)

LingDong- avatar LingDong- commented on August 15, 2024

Hi @wglnngt ,

Thanks a lot for pointing out the issues.

其一

名之 in function parameters are indeed typos, 曰「恃」 is the correct syntax, I've corrected them now: 77581d4

其二

Indeed the first snippet has syntax errors and the second one is syntactically correct. I think the compiler does a correct job of finding the error. e.g. running the first snippet on https://ide.wy-lang.org/ gives:

SyntaxError: Unexpected token '}'

And javascript:

while (true) {
  if (.length > ) {
    break;
  };
  var _ans1 = [];
  .push(_ans1);
}; /*"其它正常循環體中邏輯語句"*/
};

Which seems like the correct behavior.

Assuming that you took the snippets out of 賈憲三角 example, I think the confusion might come from the fact that the indentation are garbled due to space/tab issue (now fixed), and that I'm merging some lines to make it read more smoothly and more succint.

The actual structure is like so:

恆為是。
	若「藏」之長大於「層」者。
		乃止
	也
	吾有一列。充「藏」以其。
也。

⋯⋯

若「知甲」者。
	⋯⋯
若非。
	⋯⋯
云云。

⋯⋯

So the first part is actually a while(true){if(case)break; statement} logic, which one might write as while(!case){statement} in other languages.

其三

Oops, typo. Now corrected in d6761e2

Thanks again for spotting these mistakes!

from book.

wglnngt avatar wglnngt commented on August 15, 2024

感謝回覆與處理。例二反饋確引用不當,感謝指正。

關于例程代碼的簡寫。個人建議可以先按邏輯語法當斷則斷。易于新學者更快理解用法(新學者往往還未建立足夠的關鍵語法敏感度,且之乎者也云云之類,初學之時易就以往漢語語境經驗一眼帶過)。如:

凡「甲」中之「元」。
	施「法」於「元」。
	若其然者。
		充「乙」以「元」。
	也。
云云。

此義一目了然。后跟以簡潔版。

凡「甲」中之「元」。
	施「法」於「元」。若其然者。充「乙」以「元」也。
云云。

如此,既可明語法之要點,亦可免因疏忽導致的語法問題(上述代碼在最近更新b19072e中,仍少一結束關鍵字云云/也),后加以簡明版代碼,兩相比較,更可彰顯漢語代碼結構之美。:)

from book.

LingDong- avatar LingDong- commented on August 15, 2024

Thanks a lot @wglnngt ,

I just fixed the missing 云云 mistake: 538a000

My original plan was to use more verbosely formatted examples in the early chapters, and assume by chapter 8 the reader is familiar enough with most wenyan syntaxes that they'll be able to read the condensed ones. I also want to avoid repeating examples twice just for showing whitespace differences. But your suggestion does make a lot of sense too, let me think more about this.

Thanks!

from book.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.