in reply to RFC: Sub::Attributes -- alter subroutine context behavior with attributes
I'd rather see novoid be an attribute of it's own, rather then an argument to another. It makes sense to use on it's own, it's not logicly a subtype of another contextual thingy.
I'd also rather it be a warning then fatal. warings::warnif("void", "Useless use of $fullydecoratedname in void context"); That'd have parity with what the core does for some builtins. For that matter, you may want to have a :NoScalar and :NoList. (:NoScalar would match sort, see perldiag's "Useless use of sort in scalar context", which I've never actualy seen. I know of no analog for :NoList, but it would seem to be required for parity.) :NoVoid should also skip running of the actual sub.
|
|---|