Is Perl *that* good?
Martin Maney
maney at pobox.com
Mon May 10 13:17:31 EDT 2004
Peter Hansen <peter at engcorp.com> wrote:
> This is actually the first time in recent years that I can recall
> that someone has complained about having to make up a new variable
> (which is as good as free) to hold the result of a match. If
That's an odd way of characterizing it, since this is one of the common
forms of the FAQ more often discussed in terms of
assignment-as-operator, which used to come up about every week or so
back when I had the time to read more than an eclectic sampling of the
traffic here. The throwaway wrapper class is probably the least bad
solution - at least it can be used in thread-safe manner (1), unlike one
simply awful hack that's in the cookbook.
(1) use it as a wrapper that's instaniated locally and not shared,
which is the closest analog of how the code would go if operator= were
available, IMO&E. The bloody awful cookbook recipie is the one that
gains a little more convenience at the cost of a single globally shared
hidden variable.
--
Self-pity can make one weep, as can onions. -- Fodor
More information about the Python-list
mailing list