On Thu, 28 Nov 2019 17:04:42 +0000 Dave Mitchell <davem@iabyn.com> wrote: > 5) This is a tentative suggestion that would replace options 3) and > 4). This would be for a constraint hook to be specified as a > empty-bodied sub with a single parameter. The constraint(s) specified > for that parameter become the custom constraints which that hook > provides. In some fashion the code previously compiled for that > "prototype" sub's constraint is copied and/or executed. This would be > more efficient than calling a whole sub for each parameter, and would > more constrained than injecting text into the source code. This would be non-trivial to implement, but I have a growing collection of situations in which I would love to be able to copy (partial) optrees from one sub into another. I've often found it doesn't quite work in a naive approach but I suspect a proper effort into making it work wouldn't be that difficult. Somewhat outside of the scope of signatures as such, but it may be worth us collecting up a list of situations this could help with, to motivate an effort into looking at making it work. -- Paul "LeoNerd" Evans leonerd@leonerd.org.uk | https://metacpan.org/author/PEVANS http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/Thread Previous | Thread Next