Files
rlox/examples/test_struct.lox
T

28 lines
435 B
Lox
Raw Normal View History

Data :: struct {
number: Number,
string: String,
bool: Bool
};
Data.new :: fn(number: Number, string: String, bool: Bool) -> Self
do
return Self {
number: number,
string: string,
bool: bool
};
end;
Data.function :: fn(
self,
number: Number,
string: String,
bool: Bool,)
{number == 42} : Nil
do
self.number = number;
self.string = string;
self.bool = bool;
end;