日本語 · English

with — derived definition (overriding public words)

Translated from the canonical Japanese page reference/with.md. The source_sha above records the source revision; a consistency check flags this page when the Japanese original changes.

Category: derivation (premise-layer core) / Signature: Base with { w = … } : premise -> premise / name settled (spec §5.4)

Deriving premise Fiscal from the base premise Gregorian with with. The left box holds Gregorian's public words (day, month, year, quarter, …) and the 10 premise members. The with block in the middle overrides only year to an April start; in the right box year is replaced, quarter and yearStart, which depend on year, follow by re-resolution, and the remaining public words and premise members are inherited from the base.

Meaning

Builds a new premise on top of an existing one, replacing or adding only the public words you name (the premise → premise closure). Fiscal calendars, organization-specific calendars, added labels — all of these are this.

Name resolution is Mechanism A (ADR-17):

A derivation moves only the window cuts; calendar dates stay fixed (I1). 2026-03-01 remains “March 1” under the fiscal calendar; only the year window it belongs to changes, to fiscal 2025 (Apr 2025–Mar 2026).

Examples

A fiscal calendar (April start) is one line — it never touches month, so calendar dates and month-ends stay fixed:

# eval: 2025-01-01..2028-01-01
premise Fiscal = Gregorian with { year = month span (_ => 12) phase: 3 label: (p => yearNo(p)) }
premise FY { calendar-system: Fiscal; tz: "Asia/Tokyo"; wkst: Mon }
@FY
everyDay |> within(year) |> first
#=> 2025-04-01 2026-04-01 2027-04-01

quarter’s inherited definition (year split … by: month) automatically follows the new year and becomes the fiscal quarter:

# eval: 2026-01-01..2027-01-01
premise Fiscal = Gregorian with { year = month span (_ => 12) phase: 3 label: (p => yearNo(p)) }
premise FY { calendar-system: Fiscal; tz: "Asia/Tokyo"; wkst: Mon }
@FY
everyDay |> within(quarter) |> first
#=> 2026-01-01 2026-04-01 2026-07-01 2026-10-01

Pitfalls

rephase (sugar over with) · span · split · Mechanism A (ADR-17) · I1.