uses X as Y unit-rename import (dialect extension)
- Type: idea
- Status: rainy-day
- Owner: —
- Opened: 2026-06-06 (from todo.md §4)
Motivation
A unit-rename import is missing. uses X as Y is not standard Pascal (that's
C#/Python as); Delphi has uses U in 'file' + dotted namespaces but no
rename-import. A rename would be a deliberate dialect extension.
Open questions
- Is the ergonomic win worth a non-standard
usesform? - Interaction with qualified
UnitName.Symbollookup (already works). - Syntax:
uses X as Yvs something less Python-flavored.
Frontend parity note (2026-06-18)
The same capability is missing on both frontends, and would land as one feature if adopted:
- Pascal: no
uses X as Y(idea only). - Nil Python:
import Xworks (rewritten touses), butimport X as Y(alias) andfrom X import Yare not supported — pyparser takes onlyimport name[, name].
There is no as-for-import AST node anywhere; import/uses just feed names
to the unit resolver. (Confirms the as token is free for the is/as type-cast —
the only other as is the contextual ident in specialize ... as Name.)
Status
Idea only — decide whether to adopt before scoping. Not standard; no current
source needs it. If adopted, cover both the Pascal uses and Python import
forms together.
Log
- 2026-06-06 — ticket opened from todo.md §4.
- 2026-06-18 — recorded Python
import asis the same missing capability; no import-alias AST node exists on either frontend.