← board

uses X as Y unit-rename import (dialect extension)

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

Frontend parity note (2026-06-18)

The same capability is missing on both frontends, and would land as one feature if adopted:

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