group: func [
{Returns a block of sub-blocks with items partitioned by value.}
block [any-block!]
/local result
][
result: copy []
; First, build up a list of keys, with a place for values
; to go with each key.
foreach item block [
if not find/only/skip result item 2 [
repend result [item copy []]
]
]
; Add items to the block associated with each key.
foreach item block [append/only select result item item]
result
]
You need to create an account or log in to post comments to this site.