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
  2. Types

Type aliases

In Snowball, type aliases allow you to create alternative names for existing types, providing convenience and improving code readability. They serve as shorthand for complex or lengthy type definitions, making your code more expressive and understandable. Here's how type aliases are defined in Snowball:

For example, consider the following type alias:

type PersonID = i32;

In this case, PersonID is a type alias for the existing i32 type. You can now use PersonID instead of i32 throughout your code, providing a more meaningful and self-descriptive name when dealing with person identifiers.

Type aliases help in reducing repetition and improving code maintainability. They can be particularly useful when working with complex data structures, function signatures, or custom types. By providing clear and concise names for types, type aliases enhance code comprehension and make it easier to identify the purpose and usage of specific data.

Using type aliases allows you to give semantic meaning to your types, aiding in code documentation and making the intent of your code more evident to others who read it.

PreviousType genericsNextUnknown pointer type (void pointers)

Last updated 1 year ago

Was this helpful?

๐ŸŽญ
๐Ÿ”–