Skip to content

varargs parameter signature #711

Open
@alturkovic

Description

@alturkovic

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) => ..., "?")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions