in reply to Re^2: XS: SvPVLV examples?
in thread XS: SvPVLV examples?

substr and vec are special in the fact that they are lvalue functions.

ref returns "LVALUE" for references to PVLV variables (except it lies SCALAR for tied scalars), so it's clear "LV" refers to "lvalue".

PVLV adds the following fields to its "base class", PVMG (scalar with magic):

STRLEN xlv_targoff; STRLEN xlv_targlen; SV* xlv_targ; char xlv_type; /* k=keys .=pos x=substr v=vec /=join/re * y=alem/helem/iter t=tie T=tied HE */

The extra fields only have meaning to the associated magic handlers (found in mg.c).

Replies are listed 'Best First'.
Re^4: XS: SvPVLV examples?
by BrowserUk (Patriarch) on Sep 25, 2009 at 02:29 UTC

    I know.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Then maybe you're missing that there are no non-core magic types?

        Just because there aren't, or at least, so far I haven't located any, doesn't mean there couldn't be. Otherwise there would be no point it the '~' magic type. See item 44 in the third table below Perlguts#magic virtual tables:

        ~ PERL_MAGIC_ext (none) Available for use by ext +ensions

        For my particular purpose, substr magic would work perfectly so long as I can adjust the offset/length appropriately.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.