ligo/gitlab-pages/website/versioned_docs/version-next/language-basics-functions.md

473 B

id title original_id
version-next-language-basics-functions Functions language-basics-functions

Defining a function

// multiply(1, 2) = 2
function multiply (const a : int ; const b : int) : int is
    begin
        const result : int = a * b ;
    end with result

// add(1, 2) = 3
function add (const a : int ; const b : int) : int is
    block { skip } with a + b