@use

Imports a pack, whose constructs and datasets are then called under the pack's name.

#Attributes

packRequiredImplicit
The pack's name, written as the implicit value: @use:statistics. An unknown name is refused with the list of packs.
Can be written as shorthand: @use:value
as
A different prefix to call the pack's constructs under. It replaces the pack's own name: under as: st, statistics.normal does not resolve. It may not be a library construct's name.

#Examples

@use:statistics

graph{
    statistics.normal(mu: 0; sigma: 1)
}(
    x domain: [-4, 4]
    y domain: [0, 0.45]
)
@use(pack: statistics; as: st)

graph{
    st.uniform(a: 0; b: 1)
}

#Notes

  • The prefix is always written; there is no unqualified import. normal(…) after @use:statistics is unknown node normal.
  • A pack's datasets are reached through the prefix: #biology.lynx-hare.hare, @for:#biology.lynx-hare.
  • Only what the pack exports is reachable: pack biology does not export nosuch, followed by the list of what it does export.
  • The constructs are known after the @use, inside the construct that holds it.
  • A pack does not read the document's constants: its defaults hold even where a @let declares the same name.
  • A second import of the same pack needs as:: prefix statistics is already in use by pack statistics — a second @use of the same pack needs as: to give it a different one.

Last updated