sprig and prose docs classic docs
Syntax› Universe

Universe

Stable — Stable features are ones that have earned their place in the core prose language.

universe ClockworkVillage { }

What it is

The entry point. A universe block is where a world gets its name, and everything else in the repository belongs to it.

A repository describes one world, so it holds exactly one universe block, written once. This is the whole of ClockworkVillage so far: a named world with nothing in it yet. That is a legal universe, and a reasonable place to stop for a while.

Where it can live

At the top level of a file, never inside another block.

A universe can be spread across as many .prose files as it needs. Every file joins the same world, so only one of them carries the universe block and no file repeats the name.

How names find it

The universe is the outermost scope, and it is implicit. A declaration written on its own belongs to it — Villager is ClockworkVillage.Villager without anyone having to say so.

You never name the universe in order to put something inside it. There is only one world in a repository, so there is never a question of which.

How it breaks

  • SP001 NestedUniverseError — A universe block has to be at the top-level of the file.
  • SP013 MissingUniverseError — Every universe needs one top-level universe block.
  • SP014 MultipleUniversesError — There can be only one universe.
  • SP022 DeprecatedInClause — The in clause has been removed.

Decided in

  • ADR012 FileScopeUniverse — File-scope universe. Accepted.