Dan Sugalski <[EMAIL PROTECTED]> wrote: > foreach loopvar (1..10000) { > total[loopvar] = somedata[loopvar] + otherdata[loopvar]; > }
> If either (or both) of somedata or otherdata isn't an array of PMCs, > there's going to be an awful lot of temporary PMC creation, which is a > waste. You would need one temporary PMC per operand, which can be assigned a value and it can be created outside of the loop. To achieve the value semantics that above addition has, you have to create new destination PMCs anyway (presuming that C<total> holds PMCs). > ... We're trying to encourage the use of more compact aggregate > representations with Parrot, as currently Perl/Python/Ruby all have really > portly aggregates and part of the design goals is to allow for compact > versions in places we can be compact. I don't see the point of "compact" with ops-files 60 times of the current size (with all ki?c? permutations) and huge classes files implementing all the keyed variants. When only add_p_k_p_k_p_k is implemented, we have additional checks for NULL keys, additional calls to key_integer() to extract the array index, and additonal code to set the value of the key(s). Please read (again) my proposal in: Subject: Re: keyed vtables Date: Mon, 18 Aug 2003 09:36:40 +0200 > Dan leo