Skip to content

Attributes

cyxigo edited this page Aug 10, 2026 · 2 revisions

Introduction

Attributes are metadata for Wi compiler - an additional information that can alter how it behaves when dealing with certain variables. Syntax is simple:

var name <attr> = value;

Also can be used with require and with function parameters:

require name <attr> = "path";

var f = function(x <attr>) {
};

Now let's go over each one (there's only one, for now, welp...)

<const>

Marks variable as read-only - any attempt to reassign it will cause a compile error, e.g.:

var a <const> = 10;
a = 20;

Will result in:

compile error: cannot reassign <const> variable a
   | 
 2 | a = 20;
   |   ^
   --> file.wi:2:3

Clone this wiki locally