develooper Front page | perl.perl5.porters | Postings from February 2000

Re: [PATCH 5.5.660] better avhv patch

From:
Gurusamy Sarathy
Date:
February 28, 2000 23:05
Subject:
Re: [PATCH 5.5.660] better avhv patch
Message ID:
200002290707.XAA32545@maul.activestate.com
On Mon, 28 Feb 2000 22:13:31 EST, John Tobey wrote:
>Here is a new version of the patch that avoids op.c and instead walks
>the op tree at run time in pp_aassign.

In general, walking the optree at run time is less desirable than
compile time recognition.  I think your previous approach with
ck_aassign() was better.

>@@ -661,34 +662,68 @@
>     lelem = firstlelem;
>     ary = Null(AV*);
>     hash = Null(HV*);
>+
>+    if (!((leftop = ((BINOP*)PL_op)->op_last) &&
>+	  leftop->op_type == OP_NULL &&
>+	  leftop->op_targ == OP_LIST &&
>+	  (leftop = ((LISTOP*)leftop)->op_first) &&
>+	  leftop->op_type == OP_PUSHMARK))
>+	leftop = Nullop;
>+
>     while (lelem <= lastlelem) {
> 	TAINT_NOT;		/* Each item stands on its own, taintwise. */
> 	sv = *lelem++;
>+	if (leftop)
>+	    leftop = leftop->op_sibling;

Sure seems like a lot of work to distinguish a pseudohash from
a regular array!


Sarathy
gsar@ActiveState.com



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About