【发布时间】:2022-10-25 01:37:07
【问题描述】:
let log x = print_int x; log ;;
log 111 222;;
我期待log 打印111 并返回自身,然后在第二次调用时打印222,但它没有按预期工作,而是收到一条错误消息。为什么?如何使其按预期工作?
我也试过rec 无济于事。
File "./hello.ml", line 3, characters 8-11:
3 | log 111 222;;
^^^
Error: This expression has type int but an expression was expected of type
float
【问题讨论】:
标签: ocaml