Wenyan: 「吾有」者,簡之為「有」乎?

Created on 17 Dec 2019  ·  2Comments  ·  Source: wenyan-lang/wenyan

如題。望汝解吾憂,萬分感謝。
吾有一術。有一術。

Most helpful comment

Hi there,

Both of you are right, and what you want is already in the language :)

@kahogeoff is already a shorthand for 吾有, using which you can initialize variables like so:

有數五十。名之曰「甲」。

compare to the slightly different 吾有 syntax:

吾有一數。曰五十。名之曰「甲」。

However if you're defining a function this shorthand cannot be used because function definitions typically don't fit into one token unlike 五十.

@alluleia 今有 is already an alias for 吾有. And you can use it exactly as 吾有:

今有一數。曰五十。名之曰「甲」。

Incidentally 今有 was added the the syntax as a tribute to 九章算術, exactly what you mentioned there (while the 吾有一 syntax is partially a tribute to 譚嗣同's famous last words).

Thanks.

All 2 comments

应更之为"今有"
<九章算术>曰
今有積五萬五千二百二十五步。問︰為方幾何?
荅曰:二百三十五步。
<孙子算经>曰
今有雉、兔同笼,上有三十五头,下有九十四足。问:雉、兔各几何?答曰:雉二十 三,兔一十二

Hi there,

Both of you are right, and what you want is already in the language :)

@kahogeoff is already a shorthand for 吾有, using which you can initialize variables like so:

有數五十。名之曰「甲」。

compare to the slightly different 吾有 syntax:

吾有一數。曰五十。名之曰「甲」。

However if you're defining a function this shorthand cannot be used because function definitions typically don't fit into one token unlike 五十.

@alluleia 今有 is already an alias for 吾有. And you can use it exactly as 吾有:

今有一數。曰五十。名之曰「甲」。

Incidentally 今有 was added the the syntax as a tribute to 九章算術, exactly what you mentioned there (while the 吾有一 syntax is partially a tribute to 譚嗣同's famous last words).

Thanks.

Was this page helpful?
0 / 5 - 0 ratings