mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-17 08:34:20 +00:00
clarify doc for <= on tuple uses lexicographic order (#10069)
This commit is contained in:
committed by
Andreas Rumpf
parent
39a8ab469a
commit
8aa5d126fe
@@ -2624,8 +2624,8 @@ proc `==`*[T: tuple|object](x, y: T): bool =
|
||||
return true
|
||||
|
||||
proc `<=`*[T: tuple](x, y: T): bool =
|
||||
## generic ``<=`` operator for tuples that is lifted from the components
|
||||
## of `x` and `y`. This implementation uses `cmp`.
|
||||
## generic lexicographic ``<=`` operator for tuples that is lifted from the
|
||||
## components of `x` and `y`. This implementation uses `cmp`.
|
||||
for a, b in fields(x, y):
|
||||
var c = cmp(a, b)
|
||||
if c < 0: return true
|
||||
@@ -2633,8 +2633,8 @@ proc `<=`*[T: tuple](x, y: T): bool =
|
||||
return true
|
||||
|
||||
proc `<`*[T: tuple](x, y: T): bool =
|
||||
## generic ``<`` operator for tuples that is lifted from the components
|
||||
## of `x` and `y`. This implementation uses `cmp`.
|
||||
## generic lexicographic ``<`` operator for tuples that is lifted from the
|
||||
## components of `x` and `y`. This implementation uses `cmp`.
|
||||
for a, b in fields(x, y):
|
||||
var c = cmp(a, b)
|
||||
if c < 0: return true
|
||||
|
||||
Reference in New Issue
Block a user