[fpc-pascal] Record operator for assignment

Ryan Joseph ryan at thealchemistguild.com
Fri Apr 28 08:47:33 CEST 2017


> On Apr 28, 2017, at 1:06 PM, Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> 
> No, I mean
> 
> rec := (x + y) * 2;
> 
> The compiler has to differentiate these two.

I see. It’s the parenthesis that are problematic. I guess the solution would be curly brackets:

rec := {x: 1; y: 2; z: 1}

or some magic function like writeln:

rec := TMyRec(x: 1; y: 2; z: 1)

rec := @(x: 1; y: 2; z: 1)

etc…

Anyway it could be achieved that would be nice to have a built in constructor for records on the language level.



Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list