From 19ff7469161419ff748831d32a09e8d57bae8ab9 Mon Sep 17 00:00:00 2001 From: Andrey Makarov Date: Wed, 12 Oct 2022 17:13:43 +0300 Subject: Markdown code blocks migration part 7 (#20547) --- lib/pure/algorithm.nim | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/pure/algorithm.nim') 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 ## `_. 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]>`_ -- cgit 1.4.1-2-gfad0