Markdown code blocks migration part 7 (#20547)

This commit is contained in:
Andrey Makarov 2022-10-12 17:13:43 +03:00 • committed by GitHub
commit 19ff746916
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 426 additions and 411 deletions

View file

@ -379,22 +379,22 @@ func sort*[T](a: var openArray[T],
## `cmp`, you may use `system.cmp` or instead call the overloaded
## version of `sort`, which uses `system.cmp`.
##
## .. code-block:: nim
##
## sort(myIntArray, system.cmp[int])
## # do not use cmp[string] here as we want to use the specialized
## # overload:
## sort(myStrArray, system.cmp)
## ```nim
## sort(myIntArray, system.cmp[int])
## # do not use cmp[string] here as we want to use the specialized
## # overload:
## sort(myStrArray, system.cmp)
## ```
##
## You can inline adhoc comparison procs with the `do notation
## <manual_experimental.html#do-notation>`_. Example:
##
## .. code-block:: nim
##
## ```nim
## people.sort do (x, y: Person) -> int:
## result = cmp(x.surname, y.surname)
## if result == 0:
## result = cmp(x.name, y.name)
## ```
##
## **See also:**
## * `sort proc<#sort,openArray[T]>`_