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

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]

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.

No one has really spoken to the importance of printing ISSUE!s literally. So unlike TAG!, they are a possibility for some kind of instruction.

But I think the blank-headed path would make an excellent choice!

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

>> text: "Some really long string"

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

>> print ["Path 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.)

Skippable parameters plus PATH! is a missing link

People have long had things they wanted to say up front, vs tack at the end of function calls. Tagged COMPOSE now lets you do compose <*> [...] which is neater to look at your tag up front than with a refinement and throwing the tag to the end.

But what about skippable paths? They can be both refinement and parameter.

Consider PRINT with the integer above. Compare:

mold/limit data 50

mold /50 data

MOLD isn't necessarily the best example, as it's foundational and has to be able to mold everything including (PATH!s). But it shows a really powerful idea, and one where you can do those calculations if you want:

mold /(10 + n) data

More stuff to file under "you're not going to miss REFINEMENT! one bit". :slight_smile:

1 Like