# Returns

A function will not run any code after returning  a value. A `return` effect will function like a `stop` within a function, so a `return` should be the last thing a function needs to do.

{% hint style="info" %}
Not sure what the `stop` effect does? See the [Stops & Exits page](/syntask/limiters/terminators/stops-and-exits.md).
{% endhint %}

This also means that to return multiple objects, you need to return them all at once instead of separately:

{% code overflow="wrap" lineNumbers="true" %}

```python
function getShinyItems() :: items:
  return (1 of diamond)
  return (1 of gold ingot)
  return (1 of emerald)
```

{% endcode %}

Since a function is terminated after a return, that means only the diamond will be returned, and no code after line 2 will be run. To return multiple items, return them in a list all on the same line.

{% code overflow="wrap" lineNumbers="true" %}

```python
function getShinyItems() :: items:
  return (1 of diamond), (1 of gold ingot), and (1 of emerald)

#: Or:

function getShinyItems() :: items:
  add (1 of diamond) to {_shiny::*}
  add (1 of gold ingot) to {_shiny::*}
  add (1 of emerald) to {_shiny::*}
  return {_shiny::*}
```

{% endcode %}

{% hint style="info" %}
For more information about using returns in functions, see the [Returns page](/syntask/fundamentals/structures/functions/returns.md) and the [Returned Values page](broken://pages/4FFgAs18W5zFtDsO2O07).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://x8ight.gitbook.io/syntask/limiters/terminators/returns.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
