((Doubled Groups)) as a Dialecting Tool

In trying to get COMPOSE to lose /ONLY, there was a time when it looked for doubled groups.

>> block: [a b c]

>> compose [(block) ((block))]
== [a b c [a b c]]

I liked it, and I said:

But I found concerns:

To be fair: it's hardly the only case where if you jump to conclusions on reading a few characters that you'll have problems because the code keeps going and may invalidate the assumptions you made by looking at those few characters. But it still wasn't perfect.

...and as it turned out, it was another one of those "close but no cigar" cases of wanting to mark the intent of splice specially, but using a mechanism that's not as good as BLOCK! isotopes.

I think that doubled-up-groups are a neat example of a dialecting concept, where you might want to give that significance. It would certainly belong in the dialecting handbook (if we had one).

But in the COMPOSE case, we have a better option... compose [... (spread block) ...] (or another operator of your choice that produces block isotopes). And it's more fitting for the core, because it doesn't have the weakness mentioned above.

2 Likes