[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Copying hashes



On Mon, Jan 31, 2000 at 11:40:11PM -0500, Andrew Pimlott wrote:
> On Mon, Jan 31, 2000 at 11:01:16PM -0500, Jeff Pinyan wrote:
> > You can get this kind of override by doing this (although it's damn slow):
> > 
> >   %hash = (%values_get_overridden, %hash);
> >   %hash = (%hash, %values_override_hash);
> 
> Of course, but if those %'s were @'s, you'd say, "No, silly!  That's
> what unshift and push are for!".  I want to be able to say the same
> thing for hashes.

And if those were @'s, then the data structures would be inherently
ordered, contiguous, and indexed numerically.

> You may be able to optimize your examples under the hood, but I would
> find this optimization highly unintuitive.  Is there currently any list
> context in which arrays or hashes are magically not expanded?

It does not matter whether the optimization is intuitive or not.  The
optimization is completely hidden from the user; there is no need to intuit
it.  The behavior would be the same as it always has been.

> PS.  I support delete and exists on arrays ;)

P.S.  I support file test operators on regular expressions.

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe