Define functions expression - Clarity Smart contract Stacks

39 Views Asked by At

The expressions that define functions take one expression for the function body.

[The function body is what is executed when the function is called.]

If the body is limited to one expression only, then how can you create more complex functions that require multiple expression?

1

There are 1 best solutions below

0
On

You can use the begin function for this. It allows you to pass in multiple expressions as a single expression to the body.

https://docs.stacks.co/docs/clarity/language-functions#begin