Subject: | miterlimit() return a value? |
Date: | Tue, 02 Sep 2014 11:29:58 -0400 |
To: | bug-PDF-API2 [...] rt.cpan.org |
From: | Phil M Perry <philperry [...] hvc.rr.com> |
PDF::API2 v2.022 Perl 5.16.3 Windows 7 severity: Wishlist
In Content.pm, most methods that set some value also return whatever the
current (updated) value is, regardless of whether the method call sets a
new value. miterlimit()/meterlimit() is an exception to this. Certainly,
once the user has called it to set a value, there is one available to
return, although there may not be a clearly defined official default
value (2 or 4?). If there is a default value, I would suggest that
miterlimit() return the current value if given with no argument.
In all these cases, it may not be all that useful to return the newly
set value, as the calling program presumably already knows this value
(it just passed it to the method). What might be more useful would be to
return the OLD setting, before it's overwritten by the NEW setting.
Right now, code needs to call a method twice if it wants to preserve the
old setting -- once without an argument to return the old setting, and
then once with an argument to set the new setting. With the change, a
single call could do it: OLD = method(NEW). Would this break any
existing code?