S02 mentions "identifier extensions" in the section describing adverbial pairs with non-identifier keys (see the table reproduced below).

What are identifier extensions? I'm guessing that :<if> and :<+> are both acting as identifier extensions in these examples:

    statement_control:<if>
    infix:<+>

But what's really going on there? Are we effectively creating an identifier with non-identifier characters, or what? I've been reading such things subconsciously as operator definitions with precedence and associativity modifiers. But modifiers ought to be written after the modified quantity, as adverbs, so that would more properly be written as

    if:statement_control
    +:infix

except, of course, + isn't a valid identifier.

Another interpretation is that, for example, statement_control:<if> is the "if" token defined inside the statement_control grammar. Its similarity to hash access makes it look likes it grabbing something from out of a container.

And yes, I have tried to find in the synopses a discussion of the real meaning of references like infix:<+>, but I've been unsuccessful. Can anybody help me find the relevant synopsis?

And, if I've guessed wrong, and "identifier extensions" have nothing to do with infix:<+> and friends, then what ARE identifier extensions?

Here's the table, reproduced from S02, the uses the phrase "identifier extension":

    Simple pair         DIFFERS from    which means

    ===========         ============    ===========

    2 => <101010>       :2<101010>      radix literal 0b101010

    8 => <123>          :8<123>         radix literal 0o123

    16 => <deadbeef>    :16<deadbeef>   radix literal 0xdeadbeef

    16 => $somevalue    :16($somevalue) radix conversion function

    '' => $x            :($x)           arglist or signature literal

    '' => ($x,$y)       :($x,$y)        arglist or signature literal

    '' => <x>           :<x>            identifier extension

    '' => «x»           :«x»            identifier extension

    '' => [$x,$y]       :[$x,$y]        identifier extension

    '' => { .say }      :{ .say }       adverbial block

=thom
--
Larry Niven's Laws
#6: It is easier to destroy than create.
Bin Laden tore down the World Trade Center? Let's see him build one. If human beings didn't have a strong preference for creation, nothing would get built, ever.

Reply via email to