in reply to Re^3: Using vec() from XS
in thread Using vec() from XS
1. synthesize an OP o
That phrase means absolutely nothing to me! So I perldoc'd; I grepped the sources; I filtered the htmlise perldocs; I googled.
Only the latter turned up that phrase. And other than your post above, the only references google has to "synthesizing an[d] op", from the >25 billion web pages it indexes, are:
So, could you please explain what you mean by that?
I did look at Perl_fold_constants:
OP * Perl_fold_constants(pTHX_ register OP *o) { register OP *curop; I32 type = o->op_type; SV *sv; if (PL_opargs[type] & OA_RETSCALAR) scalar(o); if (PL_opargs[type] & OA_TARGET && !o->op_targ) o->op_targ = pad_alloc(type, SVs_PADTMP); /* integerize op, unless it happens to be C<-foo>. * XXX should pp_i_negate() do magic string negation instead? */ if ((PL_opargs[type] & OA_OTHERINT) && (PL_hints & HINT_INTEGER) && !(type == OP_NEGATE && cUNOPo->op_first->op_type == OP_CONST && (cUNOPo->op_first->op_private & OPpCONST_BARE))) { o->op_ppaddr = PL_ppaddr[type = ++(o->op_type)]; } if (!(PL_opargs[type] & OA_FOLDCONST)) goto nope; switch (type) { case OP_NEGATE: /* XXX might want a ck_negate() for this */ cUNOPo->op_first->op_private &= ~OPpCONST_STRICT; break; case OP_UCFIRST: case OP_LCFIRST: case OP_UC: case OP_LC: case OP_SLT: case OP_SGT: case OP_SLE: case OP_SGE: case OP_SCMP: /* XXX what about the numeric ops? */ if (PL_hints & HINT_LOCALE) goto nope; } if (PL_error_count) goto nope; /* Don't try to run w/ errors */ for (curop = LINKLIST(o); curop != o; curop = LINKLIST(curop)) { if ((curop->op_type != OP_CONST || (curop->op_private & OPpCONST_BARE)) && curop->op_type != OP_LIST && curop->op_type != OP_SCALAR && curop->op_type != OP_NULL && curop->op_type != OP_PUSHMARK) { goto nope; } } curop = LINKLIST(o); o->op_next = 0; PL_op = curop; CALLRUNOPS(aTHX); sv = *(PL_stack_sp--); if (o->op_targ && sv == PAD_SV(o->op_targ)) /* grab pad temp? * +/ pad_swipe(o->op_targ, FALSE); else if (SvTEMP(sv)) { /* grab mortal temp? */ (void)SvREFCNT_inc(sv); SvTEMP_off(sv); } op_free(o); if (type == OP_RV2GV) return newGVOP(OP_GV, 0, (GV*)sv); return newSVOP(OP_CONST, 0, sv); nope: return o; }
and I can relate nothing there to that phrase. So, could you please treat me like the thicko I am, and explain what ... you are suggesting, cos I just do not ... understand!
A long time ago, before the dawn of time, a young, budding mechanical engineer was taken to task for a suggestion he made, but failed to be able to explain. The upshot was: If you cannot explain it, you do not really understand it, so you should not suggest it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Using vec() from XS
by salva (Canon) on Sep 24, 2008 at 07:48 UTC |