Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: RFC: User subroutine hinting interface for autodie (terse, unhidden)by tye (Sage) |
on Mar 05, 2009 at 07:53 UTC ( [id://748448]=note: print w/replies, xml ) | Need Help?? |
I don't like the current hinting system nor your proposed improvement that hides the information and relies on a cabal to pre-compute the hints so that the unwashed masses never have to see it, know about it, or use it. I think such hidden information has a high probability to be incomplete and inconsistent such that users become very surprised why something works fine on one system and looks identical and doesn't work on some other system. But I think you can greatly simplify the hints to the point that making them visible is not a burden. I would define the following defaults:
And I would define the following options:
Then you can quite concisely represent any meaningful combination of those options:
Where ReadLine() returns an empty list on failure, undef in a scalar context. Copy() always returns a scalar which is simply false in the case of failure. A successful NextKeyword() returns either a non-empty list or (in scalar context) a string that is never '' nor '0'. GetParam() does return undef; on failure. GetCount() returns an empty string for failure. Finally, a successful NextLabel() returns either a non-empty list or (in scalar context) a string that is not ''. As for pre-computing hints, I would require that the user request the pre-computed hint so that, if the current system lacks that particular hint, the user can be made aware of the problem. I'd probably use a '?' to indicate that the user doesn't claim to know the answer and asks that the module author provide it. - tye
In Section
Meditations
|
|