Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

varargs parameter signature #711

Open
alturkovic opened this issue Sep 14, 2024 · 0 comments
Open

varargs parameter signature #711

alturkovic opened this issue Sep 14, 2024 · 0 comments
Labels

Comments

@alturkovic
Copy link

There is currently support for the following:

    + - one or more arguments of this type
        E.g. $zip has signature <a+>; it accepts one array, or two arrays, or three arrays, or...
    ? - optional argument
        E.g. $join has signature <a<s>s?:s>; it accepts an array of strings and an optional joiner string which defaults to the empty string. It returns a string.
    - - if this argument is missing, use the context value ("focus").
        E.g. $length has signature <s-:n>; it can be called as $length(OrderID) (one argument) but equivalently as OrderID.$length().

Is it possible to define a signature that accepts 0 or more json types (varargs)? I want to support something like:

expression.registerFunction("myFunction", (...args) => ..., "?")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants