Snowball Docs
SocialsContributeTry out online!Standard Library
  • ๐Ÿ‘‹Welcome to snowball!
  • Overview
    • ๐ŸˆWhy Snowball
    • โœจLanguage Features
  • fundamentals
    • ๐Ÿ› ๏ธGetting started
    • ๐Ÿ“Installation
      • โ€ผ๏ธCommon install issues
    • ๐Ÿ‘ถHello world!
  • language reference
    • ๐ŸŒGlobal Scope
    • ๐Ÿค–Functions
      • ๐ŸฃBasic syntax
      • ๐Ÿ˜ตFunction Generics
      • โ“External functions
      • ๐Ÿ”งFunction Attributes
      • ๐Ÿ’ขLLVM Functions
      • ๐ŸšชProgram Entries
    • ๐ŸŽญTypes
      • ๐Ÿ”ขPrimitive types
      • ๐Ÿ”€Reference types
      • โ˜๏ธPointer types
      • ๐Ÿ”“Mutability
      • โ‰๏ธType generics
      • ๐Ÿ”–Type aliases
      • ๐ŸšฏUnknown pointer type (void pointers)
    • ๐Ÿ”„Casting
      • ๐Ÿ”Mutability casting
      • ๐ŸฆบDynamic casting
      • ๐Ÿ‘จโ€๐ŸŽ“Type conversions
    • ๐Ÿ—๏ธClasses
      • ๐Ÿ’ผMembers
      • ๐Ÿ”’Access qualifiers
      • ๐Ÿ›‘Final classes
      • ๐ŸงAbstract classes
    • ๐Ÿ”Access qualifiers
    • โš’๏ธMacros
      • โœจBuiltin macros
    • ๐Ÿ”ซUnsafe snowball
    • ๐Ÿ˜ดGenerics
    • ๐ŸŒณCode Flow
      • โ˜๏ธIf statements
    • ๐Ÿ“ฆModules
      • ๐Ÿ‘‰Using Statement
  • snowball cli usage
    • ๐Ÿ’ปCLI usage and parameters
    • ๐ŸงชTesting mode
  • Confy
    • โš™๏ธGetting Started
    • ๐ŸˆSnowball's Schema
  • Reky Package Manager
    • ๐Ÿ“ฆGetting Started
  • coding style
    • ๐Ÿ’…The desired standard
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. language reference

Functions

PreviousGlobal ScopeNextBasic syntax

Last updated 1 year ago

Was this helpful?

Functions are first-class objects like i32 or bool and can be stored in addresses, passed as function parameters or returned by a function. Functions can be defined in many ways and can fill different purposes. Functions are called by value. This means that f(1) calls the function which is the value of the variable f. If the value does not have a function type, it will raise a compiler error.

func myFunc() {
    // Some semi-readable code here :)
}
๐Ÿค–
๐ŸฃBasic syntax