diff options
author | Andrey Makarov <ph.makarov@gmail.com> | 2022-10-12 17:13:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-12 16:13:43 +0200 |
commit | 19ff7469161419ff748831d32a09e8d57bae8ab9 (patch) | |
tree | 366a1d865f8b2cfc31421857cdc5516e63dd1eb7 /lib/pure/algorithm.nim | |
parent | 13b3ea71da8eecd4e8c61678ced3b19ef0625f6a (diff) | |
download | Nim-19ff7469161419ff748831d32a09e8d57bae8ab9.tar.gz |
Markdown code blocks migration part 7 (#20547)
Diffstat (limited to 'lib/pure/algorithm.nim')
-rw-r--r-- | lib/pure/algorithm.nim | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim index fc0eceac3..65402e9fb 100644 --- a/lib/pure/algorithm.nim +++ b/lib/pure/algorithm.nim @@ -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]>`_ |