← board

Default standard units: System + textfile

Problem

The current implicit textfile import is a token-scan special case. It works for a simple program with a program-level var f: Text, but it misses method-local Text declarations inside units:

procedure TGame.SaveTo(const path: AnsiString);
var f: Text;
begin
  Assign(f, path); Rewrite(f);
pascal26:563: error: undefined variable (Assign)

This is the wrong shape long-term. Classic Pascal expects a standard surface: System is always in scope, and text-file I/O is close enough to that surface that making users write uses textfile everywhere is awkward. At the same time, the compiler must still be buildable by FPC, and the self-host compiler should not be forced through unstable RTL while that surface is still moving.

Direction

Acceptance

Log