nk2028 / tshet-uinh-autoderiver

An online tool that automatically generates phonological reconstructions of the Qieyun system, as well as extrapolated historical and modern phonological systems derived from it
https://nk2028.shn.hk/tshet-uinh-autoderiver/
MIT License
43 stars 19 forks source link

關於要不要將 `is` 和 `when` 存入作推導方案參數 #44

Open graphemecluster opened 3 weeks ago

graphemecluster commented 3 weeks ago

想提出這個問題好久了 這樣就不用每個方案都寫一遍

/** @type { 音韻地位['屬於'] } */
const is = (...x) => 音韻地位.屬於(...x);
/** @type { 音韻地位['判斷'] } */
const when = (...x) => 音韻地位.判斷(...x);

而且因為原函數有 overload,這是通過不了 TypeScript type check 的。

graphemecluster commented 3 weeks ago

現在實在太累贅了,如果 音韻地位.{屬於,判斷} 在構造時就 bind 了,那麼即使每個方案都要寫一遍

const is = 音韻地位.屬於;
const when = 音韻地位.判斷;

還可以接受