Bug#434646: libcurses-ui-perl: toogle destroys boolean value of Checkbox

Gunnar Wolf gwolf at gwolf.org
Wed Jul 25 18:44:57 UTC 2007


Niko Tyni dijo [Wed, Jul 25, 2007 at 09:26:36PM +0300]:
> This is indeed contrary to the documentation of the 'get' method,
> which states:
> 
>  This method will return the current state of the checkbox (0 = not
>  checked, 1 = checked).
> 
> The empty string is still false, though, and will turn back to 1
> if re-toggled, so there isn't really any information lost. I think
> 'important' is an overrated severity here.

I agree, the problem is merely regarding the documentation. I don't
think the patch should really be applied - The semantics means very
little... But somebody expecting a literal 0 or 1 from a boolean field
should better expect a boolean result!

> That said, I don't see any problem with applying your fix. The uncheck()
> method "correctly" sets $this->{-checked} to 0, so people can't really
> be relying on the empty string behaviour.

You can rely on its truth value. That's the way it should be used.

-- 
Gunnar Wolf - gwolf at gwolf.org - (+52-55)5623-0154 / 1451-2244
PGP key 1024D/8BB527AF 2001-10-23
Fingerprint: 0C79 D2D1 2C4E 9CE4 5973  F800 D80E F35A 8BB5 27AF




More information about the pkg-perl-maintainers mailing list