Skip to content

有个笔误? #1

@ghost

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions