-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lang/funcs: Port the "reverse" function from the old functions set
This has the same functionality as the "reverse" function that was implemented in the "config" package, but adapted to the new language type system.
- Loading branch information
1 parent
238efff
commit 5922f5a
Showing
5 changed files
with
203 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
layout: "functions" | ||
page_title: "reverse - Functions - Configuration Language" | ||
sidebar_current: "docs-funcs-collection-reverse" | ||
description: |- | ||
The reverse function reverses a sequence. | ||
--- | ||
|
||
# `reverse` Function | ||
|
||
-> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and | ||
earlier, see | ||
[0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). | ||
|
||
`reverse` takes a sequence and produces a new sequence of the same length | ||
with all of the same elements as the given sequence but in reverse order. | ||
|
||
## Examples | ||
|
||
``` | ||
> reverse([1, 2, 3]) | ||
[ | ||
3, | ||
2, | ||
1, | ||
] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters