in reply to Re^2: Using vec() from XS
in thread Using vec() from XS

sv_insert doesn't just insert, it's the guts behind substr and s///. But I see your point.

Non-lvalue use of vec boils down to:

sv_setuv(TARG, do_vecget(src, offset, size));
which should give you what you want.

Replies are listed 'Best First'.
Re^4: Using vec() from XS
by salva (Canon) on Sep 23, 2008 at 16:33 UTC
    ...and the lvalue part just builds an SV with some magic attached and returns it.

    When a set operation is performed on the returned SV, the "set" operation from the magic vtable performs the real set on the original SV (the vector) indirectly

    That can also be easily replicated in XS code.