9
votes
Vote UpVote

Mutant records: on methods (and helpers)

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; ...
Favorite? Off-Topic? Eric @ 2012-05-07 10:19

Statistics

Visits: 811
Votes: 9
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Ericc
François
Jan Derk
knight_killer
Leif Uneus
Primoz Gabrijelcic
Yogi Yang
Zzzzz
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)