Re: [Phix Tutorial] Basic Sequence Actions

new topic     » goto parent     » topic index » view thread      » older message » newer message
_tom said...
euphoric said...

_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. grin

_tom said...

To assign an atom to an empty gap is futile-- nothing happens.

Why? That seems arbitrary.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu