Files
rexlang/examples/modules/geometry.dino
T
Your NameandClaude Sonnet 5.5 eaf9567a36 Dino compiler: language, formatter, language server, docs, editor support
Compiler in Rust (lexer, parser, checker, C codegen), maps, chars,
dino fmt, dino lsp (diagnostics, formatting, outline, definition,
hover, completion, signature help), docs, examples, VS Code/Vim files.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 23:46:12 +01:00

14 lines
342 B
Plaintext

// A module: everything marked `pub` can be used by the file that imports it.
import math
pub const UNIT = 1.0
pub struct Point {
pub x, y: float
pub func dist(other: Point): float {
return math.sqrt((x - other.x) * (x - other.x) + (y - other.y) * (y - other.y))
}
}
pub func origin(): Point { return Point{0.0, 0.0} }