Re: [perl #75676] PUSH on tied arrays

[email protected] (Dave Mitchell)
Newsgroups perl.perl5.porters
Message-ID <[email protected]>
On Fri, Jun 11, 2010 at 06:37:56AM -0700, Nicholas Clark wrote:
> However, it does mean changing the exact behaviour of tied arrays from the
> emergent behaviour they have had since the second day of their implementation:

Hmm, looking at the various docs:

Camel 2nd Ed says PUSH not done yet

Camel 3rd Ed (2000) doesn't say what PUSH should return, but its example
PUSH has push as its last statement, which means it returns the correct
value, but not explicitly.

perltie.pod, since 2000 (4ae8561836) documents PUSH, but doesn't say what
it should return. Its example includes
    return $self->FETCHSIZE();
which is a hint that PUSH should return a value.

Tie::Array's PUSH implementation looks to be explicitly wrong in its
return value, and perltie.pod recommends Tie::Array as "a good starting
point for many tie() implementations".

My feeling is that the combination of ambiguous documentation, broken
Tie::Array  and 10-year old behaviour, means that it would be too risky
to change now.

-- 
Indomitable in retreat, invincible in advance, insufferable in victory
    -- Churchill on Montgomery
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.