mirror of
https://github.com/bearlanguageorg/bear.git
synced 2026-08-26 15:37:18 +00:00
18 lines
244 B
Plaintext
18 lines
244 B
Plaintext
// lib.vr — a small library compiled to its own object file.
|
|
// vr compile examples/lib.vr -o /tmp/lib.vobj
|
|
|
|
fn double(n) {
|
|
return n * 2
|
|
}
|
|
|
|
fn square(n) {
|
|
return n * n
|
|
}
|
|
|
|
fn describe(n) {
|
|
if n > 100 {
|
|
return "big"
|
|
}
|
|
return "small"
|
|
}
|