Taking BLANK!-headed CHAIN!s Out-Of-Band

NOTE: This post was originally about using old slash-oriented "refinements" like /foo and giving them meaning in formatting dialects. Things have changed, and now those run functions... while it's :foo that's inert and used for refinements. The same ideas apply, however.


DELIMIT is the engine behind a family of functions (UNSPACED, SPACED, FAIL, PRINT, anything that uses that null/blank collapsing logic, forms things cleanly, understands not to put spaces at the ends of newlines, etc). It's stuff you don't want to redo if you can avoid it.

One thing about using it as the basis of these functions is that it doesn't leave a whole lot of room for dialecting. Let's say you have an idea for using TAG! to specify printing a number in hexadecimal:

>> x: 15
>> print [<hex> x]
0F

Trying to take TAG! for this purpose not going to please people who were building a string with unspaced [<div> stuff </div>] And if you get the idea that FAIL is going to extract errors via URL!:

fail [http://rebol.org/e/invalid-arg some-arg]

Then you're going to bother someone who wanted to just have a textual error message and point you to a URL in a string-like way that prints as part of a message...not an ID:

fail ["Must be a unit type" https://en.wikipedia.org/wiki/Unit_type]

If it evaluates everything, and everything is game to be PRINT-ed, anything using this as a basis isn't going to have much of an opportunity to dialect.

But BLANK!-headed chains will be free...

You can now put anything many things in these chains...

>> text: "Some really long string"

>> print ["Integer could be a limit:" :10 text]
Integer could be a limit: Some reall

>> print ["Chain length > 1:" :10:"..." text]
Path length > 1: Some re...

>> n: 5
>> print ["GROUP!s legal too:" :(n + 5) text]
GROUP!s legal too: Some re...

You could use pairs to give a min-size and max-size, 10x20. (PAIR! actually has the guts to do (n)x20 now and similar things, by the way, it just hasn't done it yet.)

1 Like