The name could use some workshopping.
Is your feature request related to a problem? Please describe.
callPackage style auto-args functions are powerful, but without visibility on the use of elipses - wrapping functions is messy and full of pitfalls.
Knowledge of whether a function accepts elipses would allow wrapper routines to know that they should accept and potentially process elipsed args.
Aside from making function wrapping more predictable, this is useful for dynamic type/signature checking, logging, and documentation generation.
Describe the solution you'd like
A simple predicate builtin. The implementation would be nearly identical to functionArgs but returns true/false when isformals->elipses is set.
Describe alternatives you've considered
I've used functors to carry meta fields such as __functionArgs = { foo = true; "_..." = false; } or _functionMeta.elipsedArgs = true; I've been able to simplify wrappers in a subset of my own code, but this is tedious and is hardly a good reason to use a functor rather than a function in most cases.
Additional
As an extension this might also be used to indicate whether {x, ...}: is used to drop fields, or if {x, ...} @ all: was used to hide them from functionArgs.
The use case there being that for dynamic checking the first category of usage is a form of intersectAttrs and the second is an actual variadic function.
This has more niche utility but since the fields are just sitting there in C you might as well cover all of the function introspection info. I don't feel particularly strongly about "@" though.
The name could use some workshopping.
Is your feature request related to a problem? Please describe.
callPackagestyle auto-args functions are powerful, but without visibility on the use of elipses - wrapping functions is messy and full of pitfalls.Knowledge of whether a function accepts elipses would allow wrapper routines to know that they should accept and potentially process elipsed args.
Aside from making function wrapping more predictable, this is useful for dynamic type/signature checking, logging, and documentation generation.
Describe the solution you'd like
A simple predicate builtin. The implementation would be nearly identical to
functionArgsbut returns true/false when isformals->elipsesis set.Describe alternatives you've considered
I've used functors to carry meta fields such as
__functionArgs = { foo = true; "_..." = false; }or_functionMeta.elipsedArgs = true;I've been able to simplify wrappers in a subset of my own code, but this is tedious and is hardly a good reason to use a functor rather than a function in most cases.Additional
As an extension this might also be used to indicate whether
{x, ...}:is used to drop fields, or if{x, ...} @ all:was used to hide them fromfunctionArgs.The use case there being that for dynamic checking the first category of usage is a form of
intersectAttrsand the second is an actual variadic function.This has more niche utility but since the fields are just sitting there in C you might as well cover all of the function introspection info. I don't feel particularly strongly about "@" though.