【发布时间】:2018-10-12 11:13:04
【问题描述】:
正如my post 描述的那样,我想创建一个带有 never_both 函数的 UTIL 类。
class
UTIL
create
default_create
feature -- could be in class BOOLEAN
double_implies, reversible_implies, never_both (a, b: BOOLEAN): BOOLEAN
-- Into boolean class with never_with
do
if a and b then
Result := False
else
Result := True
end
end
end
当我使用它时
invariant
never_both: {UTIL}.never_both (attached last_error, attached last_success_message)
编译器抱怨出现VUNO 错误
never_both used in the non-object call is not a class feature.
我看到了 2 个关于对象创建的符号
- {UTIL}.never_both (a, b)
- ({UTIL}).never_both (a, b)
它们有什么区别?
如果可能的话,如何在 Eiffel 中创建一个应用程序范围(如果您愿意,甚至可以是全球范围内!)对象以供此 UTIL 使用?!
我知道这是一个 TUPLE 问题,所以我把它们放在 Bold
【问题讨论】:
标签: createprocess eiffel