为什么 Ocaml 中的“断言”不被视为 bool->unit 类型的函数,而是一个关键字?

问题描述 投票:0回答:0

我不明白为什么“断言”不被视为 bool->unit 类型的函数,而是一个关键字。

# assert (2=2) ;;
- : unit = ()
# assert;;
Line 1, characters 6-8:
Error: Syntax error
ocaml
© www.soinside.com 2019 - 2024. All rights reserved.