Re: data() problems

[email protected] (Joshua N Pritikin)
Newsgroups perl.loop
Message-ID <[email protected]>
On Thu, Apr 20, 2000 at 11:39:07AM +0200, [email protected] wrote:
> thanks for this new release. One remark: it is possible to say now (debugger session):
> 
>   DB<1> $io=Event->io(parked=>1, data=>[qw(a b c d)])
>   DB<2> x $io->data
>   0  undef
>   DB<3> $io->data([qw(a b c d)])
>   DB<4> !2
>   0  ARRAY(0x23e444)
>      0  'a'
>      1  'b'
>      2  'c'
>      3  'd'

Oh!  That's bad.

> That means, "data" can be used as a method now but not as a constructor parameter. (Well, it can be used, but without
> effect.) For complete consistency, I suggest to let it behave like all other attributes - which can be set both by method
> AND constructor parameter.

Sure, except that it is not easy to determine the correct package from
inside Event::Watcher::init().

I don't know how to fix this, but I can add a warning to complain about
'data' in the constructor...

-- 
"Never ascribe to malice that which can be explained by stupidity."
                           via, but not speaking for Deutsche Bank
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.