Skip to content

Commit c311519

Browse files
committed
CHANGE: Rename MAXIMUM-OF and MINIMUM-OF to FIND-MAX and FIND-MIN
resolves: Oldes/Rebol-issues#1971
1 parent 60c7b3f commit c311519

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

src/mezz/mezz-math.reb

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ sign?: func [
6262
]
6363
]
6464

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.}
6767
series [series!] {Series to search}
6868
/skip {Treat the series as records of fixed size}
6969
size [integer!]
@@ -78,8 +78,8 @@ minimum-of: func [
7878
spot
7979
]
8080

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.}
8383
series [series!] {Series to search}
8484
/skip {Treat the series as records of fixed size}
8585
size [integer!]

src/tests/units/series-test.r3

+9
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,15 @@ Rebol [
461461
--assert [b 3 4 a 1 2] = head move/to/skip at [a 1 2 b 3 4] 4 1 3
462462
===end-group===
463463

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+
464473
===start-group=== "++ & --"
465474
;@@ https://github.com/Oldes/Rebol-issues/issues/554
466475
--test-- "++ & -- on block!"

src/tests/units/vector-test.r3

+3-3
Original file line numberDiff line numberDiff line change
@@ -444,11 +444,11 @@ Rebol [
444444
===end-group===
445445

446446

447-
===start-group=== "MAXIMUM-OF / MINIMUM-OF"
447+
===start-group=== "FIND-MAX / FIND-MIN"
448448
;@@ https://github.com/Oldes/Rebol-issues/issues/460
449449
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
452452
===end-group===
453453

454454

0 commit comments

Comments
 (0)