in reply to RFC: User subroutine hinting interface for autodie
I doubt I will ever use autodie so take that into consideration in reading the rest of my response.
use Some::Module qw(foo); use autodie::hints; autodie::hints->set_hints_for( \&foo, qw( LIST_EMPTY_OR_FALSE SCALAR_UNDEF_ONLY ) );
What exactly am I setting? Is there an implied "The following list are failure indications"? In other words, would a more intuitive interface be sub => \&foo, fail => qw//?
You mentioned the issue was context - have you considered other contexts (Want and/or Contextual::Return) - lvalue subs could be interesting?
What about letting the user define a new hint. Let's say I have a function that returns a SQL code. Some of these codes are errors and some of them aren't but only a lookup table will allow me to define this. Perhaps someone wants to duplicate system and have anything other than 0 indicate failure.
Cheers - L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: RFC: User subroutine hinting interface for autodie
by pjf (Curate) on Mar 05, 2009 at 12:54 UTC |