DelphiTools – When “record with methods” were introduced, an important feature was overlooked: mutability. This article discusses the problem, and introduces a possible syntax extension to solve it. Ideas & comments welcome! The Problem Effectively, “records with methods” treat all record “const” elements as “var“, even when they shouldn’t, and effectively ignores the compiler option “assignable constants”. Witness the following record: type TRec = record Field : Integer; procedure IncMe; end; ... procedure TRec.IncMe; ...
Visits by Source
Users who voted for this posting