Minnesota Extensible Language Tools Group
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode

Global constant declarations

Quick examples:

global defaultSuffix :: String = "_sfx";

global ones :: [Integer] = 1 :: ones;

Syntax

Global values can be declared as follows:

global name :: Type = expression;

Types are required.

FAQ

What’s the point?

Globals are just for declaring constant values of some use. Since Silver is a pure language, globals don’t have the same use as in some other languages (where they might be mutable, for instance.)

Most commonly global values declarations used as part of testing code, declaring values that will get operated on in tests several different ways.