Files
boring-lang/examples/strings.bl

32 lines
586 B
Plaintext
Raw Normal View History

2022-10-12 11:06:58 -06:00
fn main(): String {
2025-08-18 22:53:36 -06:00
let a = 2;
a;
a = 3;
a = if(true) {"asdf"} else {"fdsa"};
a.b.c.d();
a = (b + c.d()); // comment
return a.b() ;
2022-10-12 11:06:58 -06:00
}
2025-08-19 21:54:06 -06:00
type User struct {
id: i64
}
type TestTrait trait {
fn class_method(id: i64): Self;
fn instance_method(self: Self): i64;
fn default_impl(self: Self): i64;
}
impl TestTrait for User {
fn class_method(id: i64): Self {
return Self{id: id};
}
fn instance_method(self: Self): i64 {
return self.get_id();
}
fn default_impl(self: Self): i64 {
return self.instance_method();
}
}