Re: [Phix Tutorial] Basic Sequence Actions
- Posted by euphoric (admin) Jan 27, 2019
- 1417 views
_tom, can you explain the usage of a "gap?"
I've seen gaps like [2..1], but can there be other gaps, like [4..2]? And what does that do?
We can identify all gaps in a sequence as "|●|●|●|●|" ; there is a gap at the head and tail of a sequence; there is a gap between any two items. All gaps are an empty sequence {} or "" .
I think this concept really calls for a new representation. While the a[b-1..b] format works, I think it would be better to have a gap symbol (maybe).
All the gaps of a[1,2,3,4] could be:
a[%1]
a[%2]
a[%3]
a[%4]
a[%5]
I'm not saying the '%' is good for this, and I'm not saying it isn't. I just wanted something easy on the fingers for gaps.
To assign an atom to an empty gap is futile-- nothing happens.
Why? That seems arbitrary.