mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-30 04:44:44 +00:00
Change Eq(R)
to Eq
This commit is contained in:
parent
9f85c88e7e
commit
d56549f528
15 changed files with 231 additions and 196 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue