-
Notifications
You must be signed in to change notification settings - Fork 0
Attributes
cyxigo edited this page Aug 10, 2026
·
2 revisions
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...)
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
Next: FFI