-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
https://github.com/zforget/translation/blob/master/real_world_ocaml/1_02_variables_and_functions.md
处理包含*的操作符要小心。看下面的例子:
# let (***) x y = (x ** y) ** y;;
Characters 17-18:
Error: This expression has type int but an expression was expected of type float(* OCaml Utop ∗ variables-and-functions/main.topscript , continued (part 27) ∗ all code )
上面的错误是因为(*)没有被解析成操作符,而是被看成了注释!要正确工作,我们需要在前面或后面加上括号
应该是加上空格 不是括号
Metadata
Metadata
Assignees
Labels
No labels