Tin

Examples · learn/25-js-interop · 281 of 339

tool.fails

examples/learn/25-js-interop/tool.fails.tintin run examples/learn/25-js-interop/tool.fails.tin
import js "./shapes.mjs"

extern fn hypot(a: float, b: float): float

/// The length of a vector.
tool fn length(x: float, y: float): float => hypot(x, y)

agent Geometer { model: "mock", tools: [length] }

fn main() {
  print(Geometer("length 3 4"))
}