develooper Front page | perl.perl5.porters | Postings from September 2000

Re: Perl5.7.0 "overload" of %{}

Thread Previous | Thread Next
Nick Ing-Simmons
September 2, 2000 09:35
Re: Perl5.7.0 "overload" of %{}
Message ID:
Jarkko Hietaniemi <> writes:
>On Sat, Sep 02, 2000 at 02:05:55PM +0000, Nick Ing-Simmons wrote:
>> Continuing my testing of 5.7.0 I just tried a day-job OO + overload
>> app. 
>> It uses overload to build "parse trees" - Damian knows what I mean.
>> It exploded in deep recursion because the 'nomethod' overload
>> was triggered for %{}. 
>When has this change happened?  I see no discussion on p5p,
>and only these changes this year to lib/
>Change 6971 on 2000/09/01 by jhi@alpha 'Add the overload warnings to pe'
>Change 6970 on 2000/09/01 by jhi@alpha 'Subject: RE: [PATCH lib/overloa'
>Change 6969 on 2000/09/01 by jhi@alpha 'Subject: [PATCH lib/'
>Change 6860 on 2000/08/28 by jhi@alpha 'Subject: [PATCH@6855] _Minor_ c'
>Change 5527 on 2000/03/04 by gsar@auger 'make hints available via global'
>Change 5507 on 2000/03/04 by gsar@auger 'more whitespace removal (from M'
>The first three are argument checking of overload::constant, the
>fourth one is a doc patch, the fifth and sixth are code beautification.
>The gv.c which handles the guts implementation hasn't been changed
>around nomethod for a long time, either...

I suspect it has been "broken" ever since %{} & co. were invented.
I could not test the code against 5.6.0 'cos the ->isa bug breaks it.

I am trying to decipher the gv.c code.

Assuming I can find it I suggest:

A. to_hv_amg i.e. %{} and related things do not fall through to 'nomethod'

B. If %{} and co return %_[0] i.e. the object then further looping is 

(A) should avoid breakage like mine.
(B) will break out of an easy to do infinite loop and 
    a way to optimize the "access to self" if you _do_ want the overload.

Nick Ing-Simmons

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About