0

我将值“x”定义为 2

Prelude> let x=2
Prelude> :sprint x
x = _
Prelude> show x
"2"
Prelude> :sprint x
x = _
Prelude> x
2
Prelude> :sprint x
x = _
  1. Haskell 是否使用了“变量”的概念?在像 Haskell 这样的 FP 中,一切都是函数,但“x”是函数吗?
  2. 如果“let x=2”只是一个名称绑定,没有评估,然后“x”命令显示“2”,那么它已经被评估了对吗?为什么 ":sprint x" 仍然打印 "_"?
4

0 回答 0