如題。望汝解吾憂,萬分感謝。
例 吾有一術。 至 有一術。
应更之为"今有"
<九章算术>曰
今有積五萬五千二百二十五步。問︰為方幾何?
荅曰:二百三十五步。
<孙子算经>曰
今有雉、兔同笼,上有三十五头,下有九十四足。问:雉、兔各几何?答曰:雉二十 三,兔一十二
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.
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.