Search a list of records: Difference between revisions
Content added Content deleted
m (Formatting.) |
m (→{{header|Nim}}) |
||
Line 1,853: | Line 1,853: | ||
=={{header|Nim}}== |
=={{header|Nim}}== |
||
<lang Nim> |
|||
To solve this task, we define a template “findIt” similar to the templates provided by the standard library module “sequtils”. As First argument it accepts any collection providing a “pairs” iterator (yielding an index and a value), for instance a sequence (list) or a table (hash). The second argument of the template is a predicate, i.e. an expression containing the “it” variable. |
To solve this task, we define a template “findIt” similar to the templates provided by the standard library module “sequtils”. As First argument it accepts any collection providing a “pairs” iterator (yielding an index and a value), for instance a sequence (list) or a table (hash). The second argument of the template is a predicate, i.e. an expression containing the “it” variable. |
||