PtcRunner.Lisp.ProtectedNamespaces (PtcRunner v0.14.0)

Copy Markdown View Source

Single consult point for namespace protection for deployment preludes.

Reserved namespaces are host-owned and may never be declared by a deployment prelude, redefined by user code, or shadowed. The fixed host namespaces are tool, data, and ptc.core; the bounded Java surface additionally owns every admitted Java class spelling so prelude exports cannot be silently replaced by Java dispatch. The future "catalog" namespace name is deliberately deferred.

Namespace names are string-backed at the host boundary, so this module operates on binaries.

protected/1 unions the reserved set with a compiled prelude's declared namespaces — the full set of namespace names that user code must not write into. This is the seam later phases (analyzer protected-write rejection) consult.

Summary

Functions

The full protected namespace set: reserved namespaces unioned with the namespaces a compiled prelude declares.

The reserved (host-owned) namespace name set.

Whether name is a reserved host namespace.

Functions

protected(prelude)

@spec protected(PtcRunner.Lisp.Prelude.t() | nil) :: MapSet.t()

The full protected namespace set: reserved namespaces unioned with the namespaces a compiled prelude declares.

Passing nil (no prelude attached) returns just the reserved set.

reserved()

@spec reserved() :: MapSet.t()

The reserved (host-owned) namespace name set.

reserved?(name)

@spec reserved?(String.t() | atom()) :: boolean()

Whether name is a reserved host namespace.

Accepts a binary or an atom; atoms are stringified at the boundary.