develooper Front page | perl.fwp | Postings from July 2001

Re: Sorting in-place

Thread Previous | Thread Next
From:
pcg
Date:
July 31, 2001 14:27
Subject:
Re: Sorting in-place
Message ID:
20010731232728.H10116@cerebro.laendle
On Tue, Jul 31, 2001 at 09:17:33PM +0200, Abigail <abigail@foad.org> wrote:
> > force void context currently? and list context? it's possible, of course,
> > but it's extreme action at-a-distance.
> 
>     do {{EXPR; last}}

exactly what I mean ;)

> If clashes with iteration is the worst thing that can happen if you share
> hashes between different modules by different authors, I will change my
> mind about the usefulness of lexical variables.

Well, sharing hashes with modules is quite common: each time you pass
a hash into a module you either have to *know* that the module author
doesn't iterate over it or take precautions. I don't know what worse
could happen, but at least it's very common and very ugly. For example,
WAIT uses hashes to iterate over documents. If, for debugging or just for
plain verboseness you print that hash somewhere else you get an endless
loop. The only way to find this bug is by looking at WAIT's sourcecode,
or by guessing that this can possibly happen. Guessing is a very bad
programming tool.

What *are* you arguing, that values() resetting each status or nested
eachs in difefrent modules depending on each other is natural??

-- 
      -----==-                                             |
      ----==-- _                                           |
      ---==---(_)__  __ ____  __       Marc Lehmann      +--
      --==---/ / _ \/ // /\ \/ /       pcg@goof.com      |e|
      -=====/_/_//_/\_,_/ /_/\_\       XX11-RIPE         --+
    The choice of a GNU generation                       |
                                                         |

Thread Previous | Thread Next


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