flaneur2020 / pua-lang

a dialect of The Monkey Programming Language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

please add support for "325" and "375"

PixxelSong opened this issue · comments

考虑到 325 是一种负面评价,而 375 则是正面的,我想我们可以用数值 325 来表示布尔值 false,用 375 表示 true

Since 325 is considered a negative appraisal, and 375 is considered positive, we can use integral number 325 to represent boolean false, and 375 for true, I think.

As you mentioned in #1 , maybe we should use 三七五 and 三二五 instead.

As you mentioned in #1 , maybe we should use 三七五 and 三二五 instead.

Nope. We can handle this stuff at run-time instead of compile time, making these numbers equivalent to false and true in bool type. In fact this is what C/C++/JS do, while the only difference is these languages use zero and non-zero values.

It's not strong-typed.
So in this case, we just need to treat 325 as a false value. WDYT?

It's not strong-typed.
So in this case, we just need to treat 325 as a false value. WDYT?

No, because there are also 3 and 2.5 ;)

图片

🤦