Tin

Examples · modules · 326 of 339

main

A program in two files.

examples/modules/main.tintin run examples/modules/main.tin
// A program in two files. `import "./kinematics.tin"` brings in its types and
// functions; all files share one namespace, as if they were one file.
//
//   tin run examples/modules/main.tin

import "./kinematics.tin"

fn main() {
  let arm = [
    Joint { name: "shoulder", angle: 1.2, limit: 1.6 },
    Joint { name: "elbow", angle: -2.4, limit: 2.1 },
  ]
  print("over the limit: {overLimit(arm)}")
}