Killing Off Historical "SKIP" in PARSE

SKIP suggests you're not using the result. Yet historical SKIP doesn't really do that:

rebol2> parse [1] [set x skip]
rebol2> x
== 1  ; How was this "skipped" exactly?

After contemplation of many possibilities for what this might be (including *, or <*>, or ?, or just plain period (.), I settled on <any>.

>> parse [1] [x: <any>]
>> x
== 1

I'm quite happy with it--especially in light of removing ANY as a looping combinator from the default combinator set. It brings ANY to its coherent systemic meaning of ANY-ONE-OF... as opposed to ANY-NUMBER-OF.

But @IngoHohmann suggested that SKIP might be related to ELIDE. So I tried:

>> uparse "ab" ["a" skip]
== "a"

This would make SKIP equivalent to ELIDE <any>.


If you want ELIDE <ANY> just write that.

The general skip takes an argument of how much to skip, and having a PARSE analog to SKIP that takes no argument is just confusing.

It may be that SKIP taking an argument is worth having:

>> uparse "aaab" [skip (3) "b"]
== "b"

But then we have to decide what SKIP returns:

>> uparse "aaab" [skip (3)]
== ???

And you can say that particular case with 3 <any> and it's shorter.

Either Way, the Historical Use Is Pointless

So SKIP is not in UPARSE. Maybe it will have a reinvention some day with a new meaning.

Seems to me, that skip would be the natural name for your elide.

2 posts were split to a new topic: OMIT vs ELIDE