At one point, @szeng added a FLATTEN function (at least I think it was him, its only appearance is in Rebmake).
The idea was that sometimes you have a block of blocks, and you want to merge them all together:
>> flatten [[a] [b] c d [e f]]
== [a b c d e f]
>> flatten [[a] [b [c d]] c d [e f]]
== [a b [c d] c d e f]
>> flatten:deep [[a] [b [c d]] c d [e f]]
== [a b c d c d e f]
The usages in Rebmake look like:
rebmake.execution/run make rebmake.solution-class [
depends: flatten reduce [
vars
prep
t-folders
dynamic-libs
]
]
I Started Fretting Over The Semantics 
Being now the steward of this FLATTEN native, I had questions.
One set of questions are like: "Does it flatten just BLOCK!, or also GROUP! and FENCE!?"
But binding introduces more layers: "Does it bind the items using their container's binding before it tosses the container, or not?"
What kinds of refinements and interface complexities would you need to give people a good FLATTEN native?
...or Just Build Your Own Flatteners 
SPLICE! is supported by MAP-EACH:
>> map-each item [[1 2] [3 4]] [reverse copy item]
== [[2 1] [4 3]]
>> map-each item [[1 2] [3 4]] [spread reverse copy item]
== [2 1 4 3]
That makes it a superpower for writing usermode flatteners. Here's the simplest version:
flatten: lambda [block [block!]] [
map-each item block [
either block? item [spread item] [item]
]
]
If you want a :DEEP you can have that too...
flatten: lambda [block [block!] :deep] [
map-each item block [
if deep and (block? item) [
item: flatten:deep item
]
if block? item [spread item] else [item]
]
]
Or, for you traditionalists....
flatten: lambda [block [block!] :deep] [
map-each item block [
all [
deep
block? item
item: flatten:deep item
]
either block? item [spread item] [item]
]
]
Here I'm using map-each item in my enumeration (as opposed to, say map-each 'item) so you're getting bindings propagated from the blocks to the items. But if you had logic for when to bind or unbind, you could throw that in too.
What About Cycles? (Recursive References To The Same List)
For what it's worth, the old FLATTEN native didn't handle this. So it may seem we're not any worse off...
But usermode doesn't have quite the same toolset to stop cycles. For instance: if you tried to maintain a mapping via MAP! from lists to whether they've been flattened already on a given descent branch, putting a BLOCK! in as a key would freeze its mutability deeply...which isn't generally desirable.
I think that suggests we need some kind of STUB! type, which holds onto the identity of a series without being the series. Basically a pointer that keeps the little tracking entity for a list alive for GC, that you can put in a MAP! without semantically putting the value itself in the map.
(Putting things like FLATTEN in usermode helps push on these features to make sure we're not relying on them being native to accomplish their work.)
