> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/syntax_and_semantics/constructs/gather_take.md).

# Gather/Take

The `gather/take` construct was borrowed from Raku and it's an interesting one.

```ruby
var arr = gather {
    take(1)
    take(2)
    take(3)
}
say arr             # prints: [1,2,3]
```

Inside a `gather{}` block, the `take` keyword is available, which accepts a list of arguments that are stored inside an automatically created array. In the end, the gather returns the array to the caller.
