in terms of和in term of的区别

今天在看《The Swift Programming Language (Swift 3)》的访问控制章节,其中有一句话“Access levels in Swift follow an overall guiding principle: No entity can be defined in terms of another entity that has a lower (more restrictive) access level.” Excerpt From: Apple Inc. “The Swift Programming Language (Swift 3).” iBooks. 想了半天,感觉还是不是很好理解。如何翻译才好呢?

首先需要知道的是,in terms of和in term of是不同的,区别如下:

  • in terms of:按照(依据,用...词句,用...来,通过)
    It is difficult to express it in terms of science.
    要用科学的字眼来表达它是很困难的。
  • in term of:就……而言
    In term of money, he's quite rich, but not in term of happiness.
    就钱来说他很富有,但就幸福来说就不然了。

然后,结合文档里给出了两个例子:

  • A public variable cannot be defined as having an internal, file-private, or private type, because the type might not be available everywhere that the public variable is used.
  • A function cannot have a higher access level than its parameter types and return type, because the function could be used in situations where its constituent types are not available to the surrounding code.

我觉得 No entity can be defined in terms of another entity that has a lower (more restrictive) access level.可以这样翻译:没有实体可以用较低访问级别的实体定义。

你可能感兴趣的:(in terms of和in term of的区别)