Variables

Annotations Proposed

@clamp

The @clamp annotation is used to restrict a numeric variable’s value within a specified range. When applied, it ensures that the variable does not exceed the defined minimum and maximum bounds and is applied to all assignment operations involving the variable.

@clamp(0, 100) var percentage: i32 = 50
percentage = 150  // percentage is set to 100