Commit c311519 1 parent 60c7b3f commit c311519 Copy full SHA for c311519
File tree 3 files changed +16
-7
lines changed
3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,8 @@ sign?: func [
62
62
]
63
63
]
64
64
65
- minimum-of : func [
66
- {Finds the smallest value in a series}
65
+ find-min : func [
66
+ {Returns the series where the smallest value is found, or none if the series is empty. }
67
67
series [series! ] {Series to search}
68
68
/skip {Treat the series as records of fixed size}
69
69
size [integer! ]
@@ -78,8 +78,8 @@ minimum-of: func [
78
78
spot
79
79
]
80
80
81
- maximum-of : func [
82
- {Finds the largest value in a series}
81
+ find-max : func [
82
+ {Returns the series where the largest value is found, or none if the series is empty. }
83
83
series [series! ] {Series to search}
84
84
/skip {Treat the series as records of fixed size}
85
85
size [integer! ]
Original file line number Diff line number Diff line change @@ -461,6 +461,15 @@ Rebol [
461
461
--assert [b 3 4 a 1 2 ] = head move/to/skip at [a 1 2 b 3 4 ] 4 1 3
462
462
===end-group===
463
463
464
+ ===start-group=== "FIND-MAX / FIND-MIN"
465
+ b: [1 2 3 -1 ]
466
+ --test-- "FIND-MAX block!" --assert 3 = first find-max b
467
+ --test-- "FIND-MIN block!" --assert -1 = first find-min b
468
+ b: [1 a 2 b 3 c -1 d]
469
+ --test-- "FIND-MAX/skip block!" --assert 3 = first find-max/skip b 2
470
+ --test-- "FIND-MIN/skip block!" --assert -1 = first find-min/skip b 2
471
+ ===end-group===
472
+
464
473
===start-group=== "++ & --"
465
474
;@@ https://github.com/Oldes/Rebol-issues/issues/554
466
475
--test-- "++ & -- on block!"
Original file line number Diff line number Diff line change @@ -444,11 +444,11 @@ Rebol [
444
444
===end-group===
445
445
446
446
447
- ===start-group=== "MAXIMUM-OF / MINIMUM-OF "
447
+ ===start-group=== "FIND-MAX / FIND-MIN "
448
448
;@@ https://github.com/Oldes/Rebol-issues/issues/460
449
449
v: #[si32! [1 2 3 -1 ]]
450
- --test-- "MAXIMUM-OF vector!" --assert 3 = first maximum-of v
451
- --test-- "MINIMUM-OF vector!" --assert -1 = first minimum-of v
450
+ --test-- "FIND-MAX vector!" --assert 3 = first find-max v
451
+ --test-- "FIND-MIN vector!" --assert -1 = first find-min v
452
452
===end-group===
453
453
454
454
You can’t perform that action at this time.
0 commit comments