Renderingen-US

Imports

One shape covers every import:

importa ex "<source>" privata <name>

Import, from this source, privately, this name. privata and publica control whether the imported name is re-exported from your module.

From the standard library#

Norma modules are named norma:<module>.

reader locale
faber format --locale en — English reader surface
import from "norma:consolum" private consolum

main {
    print "ready"
}
faber format --locale la — canonical Faber
importa ex "norma:consolum" privata consolum

incipit {
    nota "ready"
}
faber format --locale th-TH — Thai
นำเข้า ออก "norma:consolum" ส่วนตัว consolum

เริ่ม {
    บันทึก "ready"
}
faber format --locale zh-Hans — Simplified Chinese
导入 取自 "norma:consolum" 私有 consolum

入口 {
    显示 "ready"
}
faber format --locale zh-Hant — Traditional Chinese
匯入 取自 "norma:consolum" 私有 consolum

入口 {
    註記 "ready"
}
faber format --locale vi — Vietnamese
nhập từ "norma:consolum" riêng_tư consolum

bắt_đầu {
    ghi_chú "ready"
}
faber format --locale ar — Arabic
استورد من "norma:consolum" خاص consolum

بداية {
    اعرض "ready"
}
faber format --locale hi — Hindi
आयात सेवन "norma:consolum" निजी consolum

आरंभ {
    दिखाओ "ready"
}

From a local file#

A relative path imports a sibling module. No extension.

reader locale
faber format --locale en — English reader surface
import from "./auxilium" private saluta

main {
    print "ready"
}
faber format --locale la — canonical Faber
importa ex "./auxilium" privata saluta

incipit {
    nota "ready"
}
faber format --locale th-TH — Thai
นำเข้า ออก "./auxilium" ส่วนตัว saluta

เริ่ม {
    บันทึก "ready"
}
faber format --locale zh-Hans — Simplified Chinese
导入 取自 "./auxilium" 私有 saluta

入口 {
    显示 "ready"
}
faber format --locale zh-Hant — Traditional Chinese
匯入 取自 "./auxilium" 私有 saluta

入口 {
    註記 "ready"
}
faber format --locale vi — Vietnamese
nhập từ "./auxilium" riêng_tư saluta

bắt_đầu {
    ghi_chú "ready"
}
faber format --locale ar — Arabic
استورد من "./auxilium" خاص saluta

بداية {
    اعرض "ready"
}
faber format --locale hi — Hindi
आयात सेवन "./auxilium" निजी saluta

आरंभ {
    दिखाओ "ready"
}

Importing a specific item#

The name after privata is the item, not the module — so you import exactly what you use.

reader locale
faber format --locale en — English reader surface
import from "norma:textus" private textus

main {
    print "ready"
}
faber format --locale la — canonical Faber
importa ex "norma:textus" privata textus

incipit {
    nota "ready"
}
faber format --locale th-TH — Thai
นำเข้า ออก "norma:textus" ส่วนตัว textus

เริ่ม {
    บันทึก "ready"
}
faber format --locale zh-Hans — Simplified Chinese
导入 取自 "norma:textus" 私有 textus

入口 {
    显示 "ready"
}
faber format --locale zh-Hant — Traditional Chinese
匯入 取自 "norma:textus" 私有 textus

入口 {
    註記 "ready"
}
faber format --locale vi — Vietnamese
nhập từ "norma:textus" riêng_tư textus

bắt_đầu {
    ghi_chú "ready"
}
faber format --locale ar — Arabic
استورد من "norma:textus" خاص textus

بداية {
    اعرض "ready"
}
faber format --locale hi — Hindi
आयात सेवन "norma:textus" निजी textus

आरंभ {
    दिखाओ "ready"
}

Aliasing#

as renames on the way in.

reader locale
faber format --locale en — English reader surface
import from "./auxilium" private saluta as greet

main {
    print "ready"
}
faber format --locale la — canonical Faber
importa ex "./auxilium" privata saluta ut greet

incipit {
    nota "ready"
}
faber format --locale th-TH — Thai
นำเข้า ออก "./auxilium" ส่วนตัว saluta ในชื่อ greet

เริ่ม {
    บันทึก "ready"
}
faber format --locale zh-Hans — Simplified Chinese
导入 取自 "./auxilium" 私有 saluta 作为 greet

入口 {
    显示 "ready"
}
faber format --locale zh-Hant — Traditional Chinese
匯入 取自 "./auxilium" 私有 saluta 作為 greet

入口 {
    註記 "ready"
}
faber format --locale vi — Vietnamese
nhập từ "./auxilium" riêng_tư saluta như greet

bắt_đầu {
    ghi_chú "ready"
}
faber format --locale ar — Arabic
استورد من "./auxilium" خاص saluta كـ greet

بداية {
    اعرض "ready"
}
faber format --locale hi — Hindi
आयात सेवन "./auxilium" निजी saluta रूपमें greet

आरंभ {
    दिखाओ "ready"
}

Useful when two modules export the same name, or when the original reads badly at the call site.

Re-exporting#

publica imports and re-exports, so consumers of your module see the name too.

reader locale
faber format --locale en — English reader surface
import from "norma:textus" public textus

main {
    print "ready"
}
faber format --locale la — canonical Faber
importa ex "norma:textus" publica textus

incipit {
    nota "ready"
}
faber format --locale th-TH — Thai
นำเข้า ออก "norma:textus" สาธารณะ textus

เริ่ม {
    บันทึก "ready"
}
faber format --locale zh-Hans — Simplified Chinese
导入 取自 "norma:textus" 公开 textus

入口 {
    显示 "ready"
}
faber format --locale zh-Hant — Traditional Chinese
匯入 取自 "norma:textus" 公開 textus

入口 {
    註記 "ready"
}
faber format --locale vi — Vietnamese
nhập từ "norma:textus" công_khai textus

bắt_đầu {
    ghi_chú "ready"
}
faber format --locale ar — Arabic
استورد من "norma:textus" عام textus

بداية {
    اعرض "ready"
}
faber format --locale hi — Hindi
आयात सेवन "norma:textus" सार्वजनिक textus

आरंभ {
    दिखाओ "ready"
}

Use privata unless you deliberately intend to widen your module's surface. privata is the one you want almost always.

At a glance#

FormEffect
importa ex "norma:consolum" privata consolumStandard library module
importa ex "./auxilium" privata salutaItem from a sibling file
importa ex "./auxilium" privata saluta ut greet…bound under a different name
importa ex "norma:textus" publica textusImported and re-exported

Related: Your first package for how modules sit inside a package · Packages with Cista for dependency resolution