Skip to content

Commit

Permalink
feat(docs): update docs (#563)
Browse files Browse the repository at this point in the history
feat(docs): update docs

Updates the Wing docs. See details in [workflow run].

[Workflow Run]: https://github.com/winglang/docsite/actions/runs/5813749072

------

*Automatically created via the "update-docs" workflow*
  • Loading branch information
monadabot authored Aug 9, 2023
1 parent 655a32b commit acb7bb6
Showing 1 changed file with 13 additions and 5 deletions.
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

1 comment on commit acb7bb6

@vercel
Copy link

@vercel vercel bot commented on acb7bb6 Aug 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.