Skip to main content

Built-in functions

Built-in functions are provided by the compiler, are in scope in every module, and need no module prefix. They fall into four groups:

PageFunctions
Constraintsfloat, eq
Collectionscons, head, tail, range_full, seq_len, seq_concat, seq_flatten, seq_sum, seq_any, seq_all
Mathmax_float, min_float, max_int, min_int
Viasmax_via_array

These names are reserved: a module can't declare an item with one of them or bind one with use.

The layout functions, such as rect, crect, polygon, path, text, inst, bbox, and dimension, are in the std::layout module and are imported with use. Other functions written in Argon itself live under std::; see the standard library.

Types​

CategoryTypes
ScalarsFloat, Int, Bool, String, Any, ()
GeometryRect, Polygon, Path, Point
HierarchyCell, Inst, SchematicInst
SchematicSignal, imported from std::schematic
Collections[T], (A, B)

Signature notation​

  • Arguments before the keyword list are positional and required.
  • name? is an optional keyword argument.
  • T is a type parameter inferred from the arguments.
  • Initial values end in i, such as x0i or widthi.
  • Unless stated otherwise, coordinates and dimensions are Float.