Skip to content

Commit d4614b7

Browse files
committed
FEAT: add /part refinement to remold function
related to: Oldes/Rebol-issues#983
1 parent 6c7fd45 commit d4614b7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/mezz/mezz-series.reb

+3-1
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ remold: func [
6868
/only {For a block value, mold only its contents, no outer []}
6969
/all {Mold in serialized format}
7070
/flat {No indentation}
71+
/part {Limit the length of the result}
72+
limit [integer!]
7173
][
72-
apply :mold [reduce :value only all flat]
74+
apply :mold [reduce :value only all flat part limit]
7375
]
7476

7577
charset: func [

src/tests/units/mold-test.r3

+4
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,10 @@ Rebol [
304304
;@@ https://github.com/Oldes/Rebol-issues/issues/2279
305305
--assert "[[[^/ 1^/]]]" = mold load {[[[^/1^/]]]}
306306

307+
--test-- "remold"
308+
;@@ https://github.com/Oldes/Rebol-issues/issues/983
309+
--assert {[[1 2 3 4] ["A" [1 2 3 4]]]} = remold/flat [b c]
310+
307311
===end-group===
308312

309313
===start-group=== "mold map!"

0 commit comments

Comments
 (0)