Skip to content

Middle-variadic method signatures, versus overloads with sequence arguments #14

@Renegade334

Description

@Renegade334

The current draft makes heavy use of Node.js's house delicacy, middle-variadic function signatures. This necessitates some untangling in argument parsing, particularly when combined with optional arguments, and is also not expressible in the IDL, leading to the vast majority of functions having a rather ugly any... in their IDL definition.

IDL does allow for overloads, so instead of, for example,

pipeTo(source[, ...transforms], writer[, options])

one could instead have

pipeTo(source[, transforms], writer[, options])

accurately representable in the IDL as

Promise<unsigned long long> pipeTo(any source, Writer writer, optional PipeToOptions options);
Promise<unsigned long long> pipeTo(any source, sequence<any> transforms, Writer writer, optional PipeToOptions options);

This would simplify argument parsing, and is arguably more "webby".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions