Add support for capturing included functions