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

feat(docs): update docs #563

Merged
merged 1 commit into from
Aug 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions versioned_docs/version-latest/03-language-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Wing Programming Language Reference
id: language-reference
description: The Wing Language Reference
sidebar_label: Language Reference
keywords: [Wing reference, Wing language, language, Wing language spec, Wing programming language]
---

Expand Down Expand Up @@ -1543,11 +1544,18 @@ f(1, 2, field1: 3, field2: 4);
// f(1, 2, field1: 3); // can't do this, partial expansion is not allowed
```

#### 3.6.3 Roadmap

The following features are not yet implemented, but we are planning to add them in the future:

* Variadic arguments (`...args`) - see https://github.com/winglang/wing/issues/125 to track.
#### 3.6.3 Variadic Arguments
When a function signature's final parameter is denoted by `...` and annotated as an `Array` type,
then the function accepts typed variadic arguments.
Inside the function, these arguments can be accessed using the designated variable name,
just as you would with a regular array instance.
```TS
let f = (x: num, ...args: Array<num>) => {
log("${x + args.length}");
};
// last arguments are expanded into their array
f(4, 8, 15, 16, 23, 42); // logs 9
```

[`▲ top`][top]

Expand Down