Change Eq(R) to Eq

This commit is contained in:
Shunsuke Shibayama 2022-10-25 01:53:52 +09:00
parent 9f85c88e7e
commit d56549f528
15 changed files with 231 additions and 196 deletions

View file

@ -1,6 +1,6 @@
# e.g. `nightly.0`
.Identifier = Class { .name = Str; .num = Nat }
.Identifier|.Identifier <: Eq(.Identifier)|.
.Identifier|.Identifier <: Eq|.
__eq__ self, other: .Identifier =
self.name == other.name and self.num == other.num
@ -16,9 +16,9 @@
[_, True, _, True, True] -> True
_ -> False
]#
.Version|.Version <: Eq(.Version)|.
.Version|.Version <: Eq|.
__eq__ self, other: .Version =
self.major == other.major and self.minor == other.minor and self.patch == other.patch # and self.pre == other.pre
self.major == other.major and self.minor == other.minor and self.patch == other.patch and self.pre == "" # other.pre
if! __name__ == "__main__", do!:
v = .Version.new(0, 0, 1)