@@ -359,7 +359,7 @@ func distribute*[T](s: seq[T], num: Positive, spread = true): seq[seq[T]] =
359
359
result [i].add (s[g])
360
360
first = last
361
361
362
- func map * [T, S](s: openArray [T], op: proc (x: T): S {.closure .}):
362
+ proc map * [T, S](s: openArray [T], op: proc (x: T): S {.closure .}):
363
363
seq [S]{.inline .} =
364
364
# # Returns a new sequence with the results of `op` proc applied to every
365
365
# # item in the container `s`.
@@ -373,7 +373,7 @@ func map*[T, S](s: openArray[T], op: proc (x: T): S {.closure.}):
373
373
# # See also:
374
374
# # * `sugar.collect macro<sugar.html#collect.m%2Cuntyped%2Cuntyped>`_
375
375
# # * `mapIt template<#mapIt.t,typed,untyped>`_
376
- # # * `apply func <#apply,openArray[T],proc(T)_2>`_ for the in-place version
376
+ # # * `apply proc <#apply,openArray[T],proc(T)_2>`_ for the in-place version
377
377
# #
378
378
runnableExamples:
379
379
let
@@ -385,7 +385,7 @@ func map*[T, S](s: openArray[T], op: proc (x: T): S {.closure.}):
385
385
for i in 0 ..< s.len:
386
386
result [i] = op (s[i])
387
387
388
- func apply * [T](s: var openArray [T], op: proc (x: var T) {.closure .})
388
+ proc apply * [T](s: var openArray [T], op: proc (x: var T) {.closure .})
389
389
{.inline .} =
390
390
# # Applies `op` to every item in `s` modifying it directly.
391
391
# #
@@ -396,7 +396,7 @@ func apply*[T](s: var openArray[T], op: proc (x: var T) {.closure.})
396
396
# #
397
397
# # See also:
398
398
# # * `applyIt template<#applyIt.t,untyped,untyped>`_
399
- # # * `map func <#map,openArray[T],proc(T)>`_
399
+ # # * `map proc <#map,openArray[T],proc(T)>`_
400
400
# #
401
401
runnableExamples:
402
402
var a = @ [" 1" , " 2" , " 3" , " 4" ]
@@ -405,7 +405,7 @@ func apply*[T](s: var openArray[T], op: proc (x: var T) {.closure.})
405
405
406
406
for i in 0 ..< s.len: op (s[i])
407
407
408
- func apply * [T](s: var openArray [T], op: proc (x: T): T {.closure .})
408
+ proc apply * [T](s: var openArray [T], op: proc (x: T): T {.closure .})
409
409
{.inline .} =
410
410
# # Applies `op` to every item in `s` modifying it directly.
411
411
# #
@@ -416,7 +416,7 @@ func apply*[T](s: var openArray[T], op: proc (x: T): T {.closure.})
416
416
# #
417
417
# # See also:
418
418
# # * `applyIt template<#applyIt.t,untyped,untyped>`_
419
- # # * `map func <#map,openArray[T],proc(T)>`_
419
+ # # * `map proc <#map,openArray[T],proc(T)>`_
420
420
# #
421
421
runnableExamples:
422
422
var a = @ [" 1" , " 2" , " 3" , " 4" ]
@@ -425,7 +425,7 @@ func apply*[T](s: var openArray[T], op: proc (x: T): T {.closure.})
425
425
426
426
for i in 0 ..< s.len: s[i] = op (s[i])
427
427
428
- func apply * [T](s: openArray [T], op: proc (x: T) {.closure .}) {.inline , since : (1 , 3 ).} =
428
+ proc apply * [T](s: openArray [T], op: proc (x: T) {.closure .}) {.inline , since : (1 , 3 ).} =
429
429
# # Same as `apply` but for proc that do not return and do not mutate `s` directly.
430
430
runnableExamples:
431
431
var message: string
@@ -442,7 +442,7 @@ iterator filter*[T](s: openArray[T], pred: proc(x: T): bool {.closure.}): T =
442
442
# #
443
443
# # See also:
444
444
# # * `sugar.collect macro<sugar.html#collect.m%2Cuntyped%2Cuntyped>`_
445
- # # * `fliter func <#filter,openArray[T],proc(T)>`_
445
+ # # * `fliter proc <#filter,openArray[T],proc(T)>`_
446
446
# # * `filterIt template<#filterIt.t,untyped,untyped>`_
447
447
# #
448
448
runnableExamples:
@@ -456,7 +456,7 @@ iterator filter*[T](s: openArray[T], pred: proc(x: T): bool {.closure.}): T =
456
456
if pred (s[i]):
457
457
yield s[i]
458
458
459
- func filter * [T](s: openArray [T], pred: proc (x: T): bool {.closure .}): seq [T]
459
+ proc filter * [T](s: openArray [T], pred: proc (x: T): bool {.closure .}): seq [T]
460
460
{.inline .} =
461
461
# # Returns a new sequence with all the items of `s` that fulfilled the
462
462
# # predicate `pred` (function that returns a `bool`).
@@ -468,7 +468,7 @@ func filter*[T](s: openArray[T], pred: proc(x: T): bool {.closure.}): seq[T]
468
468
# # * `sugar.collect macro<sugar.html#collect.m%2Cuntyped%2Cuntyped>`_
469
469
# # * `filterIt template<#filterIt.t,untyped,untyped>`_
470
470
# # * `filter iterator<#filter.i,openArray[T],proc(T)>`_
471
- # # * `keepIf func <#keepIf,seq[T],proc(T)>`_ for the in-place version
471
+ # # * `keepIf proc <#keepIf,seq[T],proc(T)>`_ for the in-place version
472
472
# #
473
473
runnableExamples:
474
474
let
@@ -483,19 +483,19 @@ func filter*[T](s: openArray[T], pred: proc(x: T): bool {.closure.}): seq[T]
483
483
if pred (s[i]):
484
484
result .add (s[i])
485
485
486
- func keepIf * [T](s: var seq [T], pred: proc (x: T): bool {.closure .})
486
+ proc keepIf * [T](s: var seq [T], pred: proc (x: T): bool {.closure .})
487
487
{.inline .} =
488
488
# # Keeps the items in the passed sequence `s` if they fulfilled the
489
489
# # predicate `pred` (function that returns a `bool`).
490
490
# #
491
491
# # Note that `s` must be declared as a ``var``.
492
492
# #
493
- # # Similar to the `filter func <#filter,openArray[T],proc(T)>`_,
493
+ # # Similar to the `filter proc <#filter,openArray[T],proc(T)>`_,
494
494
# # but modifies the sequence directly.
495
495
# #
496
496
# # See also:
497
497
# # * `keepItIf template<#keepItIf.t,seq,untyped>`_
498
- # # * `filter func <#filter,openArray[T],proc(T)>`_
498
+ # # * `filter proc <#filter,openArray[T],proc(T)>`_
499
499
# #
500
500
runnableExamples:
501
501
var floats = @ [13.0 , 12.5 , 5.8 , 2.0 , 6.1 , 9.9 , 10.1 ]
@@ -576,7 +576,7 @@ template filterIt*(s, pred: untyped): untyped =
576
576
# # Returns a new sequence with all the items of `s` that fulfilled the
577
577
# # predicate `pred`.
578
578
# #
579
- # # Unlike the `filter func <#filter,openArray[T],proc(T)>`_ and
579
+ # # Unlike the `filter proc <#filter,openArray[T],proc(T)>`_ and
580
580
# # `filter iterator<#filter.i,openArray[T],proc(T)>`_,
581
581
# # the predicate needs to be an expression using the `it` variable
582
582
# # for testing, like: `filterIt("abcxyz", it == 'x')`.
@@ -586,7 +586,7 @@ template filterIt*(s, pred: untyped): untyped =
586
586
# #
587
587
# # See also:
588
588
# # * `sugar.collect macro<sugar.html#collect.m%2Cuntyped%2Cuntyped>`_
589
- # # * `fliter func <#filter,openArray[T],proc(T)>`_
589
+ # # * `fliter proc <#filter,openArray[T],proc(T)>`_
590
590
# # * `filter iterator<#filter.i,openArray[T],proc(T)>`_
591
591
# #
592
592
runnableExamples:
@@ -606,12 +606,12 @@ template keepItIf*(varSeq: seq, pred: untyped) =
606
606
# # Keeps the items in the passed sequence (must be declared as a `var`)
607
607
# # if they fulfilled the predicate.
608
608
# #
609
- # # Unlike the `keepIf func <#keepIf,seq[T],proc(T)>`_,
609
+ # # Unlike the `keepIf proc <#keepIf,seq[T],proc(T)>`_,
610
610
# # the predicate needs to be an expression using
611
611
# # the `it` variable for testing, like: `keepItIf("abcxyz", it == 'x')`.
612
612
# #
613
613
# # See also:
614
- # # * `keepIf func <#keepIf,seq[T],proc(T)>`_
614
+ # # * `keepIf proc <#keepIf,seq[T],proc(T)>`_
615
615
# # * `filterIt template<#filterIt.t,untyped,untyped>`_
616
616
# #
617
617
runnableExamples:
@@ -650,13 +650,13 @@ since (1, 1):
650
650
if pred: result += 1
651
651
result
652
652
653
- func all * [T](s: openArray [T], pred: proc (x: T): bool {.closure .}): bool =
653
+ proc all * [T](s: openArray [T], pred: proc (x: T): bool {.closure .}): bool =
654
654
# # Iterates through a container and checks if every item fulfills the
655
655
# # predicate.
656
656
# #
657
657
# # See also:
658
658
# # * `allIt template<#allIt.t,untyped,untyped>`_
659
- # # * `any func <#any,openArray[T],proc(T)>`_
659
+ # # * `any proc <#any,openArray[T],proc(T)>`_
660
660
# #
661
661
runnableExamples:
662
662
let numbers = @ [1 , 4 , 5 , 8 , 9 , 7 , 4 ]
@@ -672,12 +672,12 @@ template allIt*(s, pred: untyped): bool =
672
672
# # Iterates through a container and checks if every item fulfills the
673
673
# # predicate.
674
674
# #
675
- # # Unlike the `all func <#all,openArray[T],proc(T)>`_,
675
+ # # Unlike the `all proc <#all,openArray[T],proc(T)>`_,
676
676
# # the predicate needs to be an expression using
677
677
# # the `it` variable for testing, like: `allIt("abba", it == 'a')`.
678
678
# #
679
679
# # See also:
680
- # # * `all func <#all,openArray[T],proc(T)>`_
680
+ # # * `all proc <#all,openArray[T],proc(T)>`_
681
681
# # * `anyIt template<#anyIt.t,untyped,untyped>`_
682
682
# #
683
683
runnableExamples:
@@ -692,13 +692,13 @@ template allIt*(s, pred: untyped): bool =
692
692
break
693
693
result
694
694
695
- func any * [T](s: openArray [T], pred: proc (x: T): bool {.closure .}): bool =
695
+ proc any * [T](s: openArray [T], pred: proc (x: T): bool {.closure .}): bool =
696
696
# # Iterates through a container and checks if some item fulfills the
697
697
# # predicate.
698
698
# #
699
699
# # See also:
700
700
# # * `anyIt template<#anyIt.t,untyped,untyped>`_
701
- # # * `all func <#all,openArray[T],proc(T)>`_
701
+ # # * `all proc <#all,openArray[T],proc(T)>`_
702
702
# #
703
703
runnableExamples:
704
704
let numbers = @ [1 , 4 , 5 , 8 , 9 , 7 , 4 ]
@@ -714,12 +714,12 @@ template anyIt*(s, pred: untyped): bool =
714
714
# # Iterates through a container and checks if some item fulfills the
715
715
# # predicate.
716
716
# #
717
- # # Unlike the `any func <#any,openArray[T],proc(T)>`_,
717
+ # # Unlike the `any proc <#any,openArray[T],proc(T)>`_,
718
718
# # the predicate needs to be an expression using
719
719
# # the `it` variable for testing, like: `anyIt("abba", it == 'a')`.
720
720
# #
721
721
# # See also:
722
- # # * `any func <#any,openArray[T],proc(T)>`_
722
+ # # * `any proc <#any,openArray[T],proc(T)>`_
723
723
# # * `allIt template<#allIt.t,untyped,untyped>`_
724
724
# #
725
725
runnableExamples:
@@ -946,7 +946,7 @@ template mapIt*(s: typed, op: untyped): untyped =
946
946
# #
947
947
# # See also:
948
948
# # * `sugar.collect macro<sugar.html#collect.m%2Cuntyped%2Cuntyped>`_
949
- # # * `map func <#map,openArray[T],proc(T)>`_
949
+ # # * `map proc <#map,openArray[T],proc(T)>`_
950
950
# # * `applyIt template<#applyIt.t,untyped,untyped>`_ for the in-place version
951
951
# #
952
952
runnableExamples:
@@ -1007,14 +1007,14 @@ template mapIt*(s: typed, op: untyped): untyped =
1007
1007
map (s, f)
1008
1008
1009
1009
template applyIt * (varSeq, op: untyped ) =
1010
- # # Convenience template around the mutable `apply` func to reduce typing.
1010
+ # # Convenience template around the mutable `apply` proc to reduce typing.
1011
1011
# #
1012
1012
# # The template injects the `it` variable which you can use directly in an
1013
1013
# # expression. The expression has to return the same type as the sequence you
1014
1014
# # are mutating.
1015
1015
# #
1016
1016
# # See also:
1017
- # # * `apply func <#apply,openArray[T],proc(T)_2>`_
1017
+ # # * `apply proc <#apply,openArray[T],proc(T)_2>`_
1018
1018
# # * `mapIt template<#mapIt.t,typed,untyped>`_
1019
1019
# #
1020
1020
runnableExamples:
0 commit comments