take println from io;
type Vector
{
int x;
int y;
int z;
constructor (float x, float y, float z)
{
.x = x;
.y = y;
.z = z;
}
operator + (Vector vector) -> Vector
{
return Vector(
x + vector.x,
y + vector.y,
z + vector.z,
);
}
cast String
{
return `[{x}, {y}, {z}]`;
}
}
let v1 := Vector(1, 2, 3);
let v2 := Vector(4, 5, 6);
let v3 := v1 + v2;
println(`{v1} + {v2} = {v3}`);
🔣 A safe and statically typed programming language
License
sleepy-monax/udfore
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
Repository files navigation
About
🔣 A safe and statically typed programming language